function openPopUp_520x390(href, target)
{
	window.open(href, target, 'width=520, height=390, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function openPopUp_600x450(href, target)
{
	window.open(href, target, 'width=800, height=600, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function blinkIt()
{
	if(!document.all)
		return;
	else
	{
		for(i=0; i<document.all.tags('blink').length; i++)
		{
			s=document.all.tags('blink')[i];
			s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
		}
	}
}
function changeTarget(elm)
{
	tmp = elm.getElementsByTagName("a");
	for(i=0; i<tmp.length; i++)
		tmp[i].target = "_blank";
}
function SysError()
{
	return true;
}
function deleteConfirm()
{
	var restart = confirm("Bu Kayıtı Silmek İstediğinizden Emin misiniz?");
	if(restart)
		return true;
	else
		return false;
}
function onlyNumber()
{
	if (event.keyCode < 48 || event.keyCode> 57) event.returnValue = false;
}
function location_clearAndHide(level)
{
	level = level * 1;
	
	for(i=level; i<4; i++)
	{
		document.getElementById('location_SLC_Level' + i).options.length = 0;
		document.getElementById('location_TR_Level' + i).style.display = 'none';
	}
	
}

function locationShow(PID, level, selectedValue)
{
	var showLevel = false;
	
	
	
	if(selectedValue)
		document.getElementById('country_province_sub_province').value = selectedValue;
	else
		document.getElementById('country_province_sub_province').value = PID;
	
	if(level == "0")
		return;
	
	location_clearAndHide(level);

	if(PID == "0")
		return;

	pidLevel = PID.length + 5;

	location_SLC = document.getElementById("location_SLC_Level" + level);
	
	location_SLC.options[location_SLC.length] = new Option("--", "0");
	
	for(i = 0; i < location_loopcount; i++)
	{
		if(location_Id[i].indexOf(PID) == 0 && location_Id[i].length == pidLevel)
		{
			location_SLC.options[location_SLC.length] = new Option(location_Name[i], location_Id[i]);
			
			if(location_Id[i] == selectedValue)
			{
				location_SLC.options[location_SLC.length - 1].selected = true;
			}
				
			showLevel = true;
		}
	}
	if(showLevel)
	{
		document.getElementById("location_TR_Level" + level).style.display = '';
	}
}
function tax_location_clearAndHide(level)
{
	level = level * 1;
	
	for(i=level; i<4; i++)
	{
		document.getElementById('tax_location_SLC_Level' + i).options.length = 0;
		document.getElementById('tax_location_TR_Level' + i).style.display = 'none';
	}
}
function tax_locationShow(PID, level, selectedValue)
{
	var showLevel = false;
	
	if(selectedValue)
		document.getElementById('tax_country_province_sub_province').value = selectedValue;
	else
		document.getElementById('tax_country_province_sub_province').value = PID;
	
	if(level == "0")
		return;
	
	tax_location_clearAndHide(level);

	if(PID == "0")
		return;

	pidLevel = PID.length + 5;

	location_SLC = document.getElementById("tax_location_SLC_Level" + level);
	
	location_SLC.options[location_SLC.length] = new Option("--", "0");
	
	for(i = 0; i < location_loopcount; i++)
	{
		if(location_Id[i].indexOf(PID) == 0 && location_Id[i].length == pidLevel)
		{
			location_SLC.options[location_SLC.length] = new Option(location_Name[i], location_Id[i]);
			
			if(location_Id[i] == selectedValue)
			{
				location_SLC.options[location_SLC.length - 1].selected = true;
			}
				
			showLevel = true;
		}
	}
	if(showLevel)
	{
		document.getElementById("tax_location_TR_Level" + level).style.display = '';
	}
}
function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL, winName, features);
}
function changeImage(imgID, strEx)
{
	var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.0)";

	if (document.getElementById)
	{
		var imgobj=document.getElementById('preview')
		if (imgobj.filters && window.createPopup)
		{
			imgobj.style.filter=filterstring
			imgobj.filters[0].Apply()
		}
		imgobj.innerHTML=strEx.replace('{1}',imgID); 
		if (imgobj.filters && window.createPopup)
			imgobj.filters[0].Play()
		return false
	}
	
	return false;
}
prevStepIndex = -1;
function stepChange(idx)
{
	if(prevStepIndex == idx)
		return;
	
	if(prevStepIndex < idx && prevStepIndex > 0)
		if(!submitForm(document.getElementById('payment_form')))
			return;
	
	document.getElementById('step_' + idx).style.display = 'block';
	//document.getElementById('step_' + idx).style.background = 'url(images/tr/step_' + idx + '_b.jpg) no-repeat right 40px';
	document.getElementById('step_image_' + idx).style.filter = '';
	if(prevStepIndex != "-1")
	{
		document.getElementById('step_' + prevStepIndex).style.display = 'none';
		document.getElementById('step_image_' + prevStepIndex).style.filter = 'gray';
	}
	prevStepIndex = idx;
}
prevStepSignUpIndex = -1;
function stepChangeSignUp(idx)
{
	if(prevStepSignUpIndex == idx)
		return;
	
	if(prevStepSignUpIndex < idx && prevStepSignUpIndex > 0)
		if(!submitForm(document.getElementById('member_form')))
			return;
	
	document.getElementById('step_' + idx).style.display = 'block';
	document.getElementById('step_image_' + idx).style.filter = '';
	if(prevStepSignUpIndex != "-1")
	{
		document.getElementById('step_' + prevStepSignUpIndex).style.display = 'none';
		document.getElementById('step_image_' + prevStepSignUpIndex).style.filter = 'filter: gray alpha(Opacity=40)';
	}
	prevStepSignUpIndex = idx;
	window.location = "#";
}