var shownsection = 0;
function menuswitch(idnum)
{
	if(document.getElementById){
		if(document.getElementById("menudiv"+idnum)){
			var elem = document.getElementById("menudiv"+idnum);
			var hdr = document.getElementById("menuHeader"+idnum)
			if(elem == null) { return; }
			if(elem.style.display == "none")
			{
				if(hdr != null)	{hdr.className="menuHeaderOpen";	}
				elem.style.display = "block";
				if(document.getElementById("menuplus"+idnum)){document.getElementById("menuplus"+idnum).style.display = "none";}
				if(document.getElementById("menuminus"+idnum)){document.getElementById("menuminus"+idnum).style.display = "";}
			}
			else
			{
				elem.style.display = "none";
				if(hdr != null)	{	hdr.className="menuHeaderClosed";	}
				if(document.getElementById("menuplus"+idnum)){document.getElementById("menuplus"+idnum).style.display = "";}
				if(document.getElementById("menuminus"+idnum)){document.getElementById("menuminus"+idnum).style.display = "none";}
			}
		}
		if (navigator.appName != "Netscape") //due to bug 7993, cancelBubble could make netscape hang, so do not use it in netscape. IE is fine.
			window.event.cancelBubble = true;
		return false;
	}

}
function gss_hidefaqs()
{
	if(document.getElementsByTagName){
		var divarray = new Array();
		divarray = document.getElementsByTagName("div");
		for(i=0; i<divarray.length; i++){
			if(divarray[i].id){
				if(divarray[i].id.indexOf("menudiv") > -1){
					if(divarray[i].style.display != "none"){
						menuswitch(divarray[i].id.replace("menudiv", ""));
					}
				}
			}
		}
	}
}
function doUnload()
{
 if (window.event.clientX < 0 && window.event.clientY < 0)
 {
   window.open("Signout.aspx?closeButtonOn=1","MSCRM_MAIN", "height=200,width=200,scrollbars=0,top=0, left=0, menubar=0, location=0, resizable=0, status=1")
 }
}

function fHelp()
{
	var height = screen.height;
	height=height-300
	var golink;
	golink="Help.jsp"
	window.open(golink,"HARPAK_HELP",'toolbar=0,location=0,directories=0,status=1, menubar=0,scrollbars=1,resizable=0,left=130,width=500,height=' + height + ',top=0,copyhistory=0');
}


// INPUT FORMATLAYAN SCRIPTLER
function Amount_onkeyup(thisis) {
	//alert("aa: "+thisis.value);

	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0)
	{	// çalışma
		//alert(str);
		//str = str.replace(".","");
		//alert(str);

		while ( 15 > i)
		{
			str = str.replace(".","");
			i=i+1;
		}
		commacount=0;
		commapos=str.indexOf(";");

		if (commapos>=0)
		{
			aftercomma=str.substr(commapos);
			str=str.substr(0,commapos);
		}
		else
			aftercomma="";

		if (str.length > 3)
		{
			tempstr=str;
			newstr="";
			while (tempstr.length>3)
			{
				newstr="."+tempstr.substr(tempstr.length-3)+newstr;
				tempstr=tempstr.substr(0,tempstr.length-3);
			}
			thisis.value = tempstr+newstr+aftercomma;
		}
		else //Aysun
		{
			str = str.replace(".","");
			thisis.value=str
		}
	}//indexOf
	return true;
}
function Dateonkeyup(thisis) {
	//alert("ea: "+thisis.value);

	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0)
	{	// çalışma
		//alert(str);
		//str = str.replace("/","");
		//alert(str);

		while ( 15 > i)
		{
			str = str.replace("/","");
			i=i+1;
		}
		commacount=0;
		commapos=str.indexOf(";");

		if (commapos>=0)
		{
			aftercomma=str.substr(commapos);
			str=str.substr(0,commapos);
		}
		else
			aftercomma="";

		if (str.length > 2 && str.length < 11)
		{
			tempstr=str;
			newstr="";
			var numCounter = 0;
			var flag = 0;
			while (tempstr.length>2 && numCounter < 2)
			{
				newstr=newstr+tempstr.substr(0,2)+"/";
				tempstr=tempstr.substr(2,tempstr.length-2);
				numCounter++;
			}
			thisis.value = newstr+tempstr+aftercomma;
		}
		else
		{
			str = str.replace("/","");
			thisis.value=str
		}
	}//indexOf
	return true;
}

function gotourl(url)
{
    window.open(url,"METIS");
}



