
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("div"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function SwitchMenu(containerID, obj, active, passive1){

	if(document.getElementById(obj)!=null)
	{
		var el = document.getElementById(obj);
		var container = document.getElementById(containerID);
		
		if(el.style.display == "none")
		{
			el.style.display = "block";
			container.style.display = "none";
		}
		else if(container.style.display == "none")
		{
			el.style.display = "none";
			container.style.display = "block";
		}
		
		document.getElementById(active).className="tab_secilmis";
		document.getElementById(passive1).className="tab_secilmemis";
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate












function isFlash(inVersion){
 FlashMode = 0;
 if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
   var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
   versionIndex = parseInt( versionString );
   if ( versionIndex >= inVersion ) {
     FlashMode = 1;
   }
  }
 }
 else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
    && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
  theStr='FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+inVersion+'"))) \n';
  document.write('<script language=VBScript\> \n');
  document.write('on error resume next \n');
  document.write(theStr);
  document.write('</script\> \n');
   
 }
 return FlashMode;
}


function insertFlash(i_minVersion, i_path, i_name, i_width, i_height, i_bgcolor, i_fb,i_link,i_fblink, transparent) {
	//alert (navigator.userAgent);
  if (isFlash(i_minVersion)){
  	if(i_link){
   		i_link=escape(i_link);
		var linkarray=i_link.split("/");
		i_link=linkarray.join("%2F");
   		i_path=i_path+i_link;
   }
  document.write(' <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write(' codebase="../../../../active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0/default.htm"');
  document.write(' ID="' + i_name + '" width="' + i_width + '" height="' + i_height + '">');
  document.write(' <param name=movie value="' + i_path +'"> ');
  document.write(' <param name=quality value=high> ');
  document.write(' <param name=menu value=false> ');
  document.write(' <param name=WMode value=' + i_bgcolor + '> ');
  if(transparent)
  document.write(' <param name=wmode value=transparent> ');
  document.write(' <embed src="' + i_path +'"');
  if(transparent)
  document.write(' wmode=transparent ');
  document.write(' name=' + i_name + ' swLiveConnect="true" width="' + i_width + '" height="' + i_height + '"');
  document.write(' quality="high" wmode="transparent" menu="false" bgcolor="#' + i_bgcolor + '"');
  document.write(' type="application/x-shockwave-flash" pluginspage="../../../../www.macromedia.com/shockwave/download/download.cgi@P1_Prod_Version=ShockwaveFlash.htm">');
  document.write('</embed>');
  document.write('</object>');
 }else {
 	if(i_fblink){
     document.write('<a href="'+i_fblink+'"><img src="' + i_fb+'" width="'+i_width+'" height="'+i_height+'" border="0"></a>');
	}else{
		document.write('<img src="' + i_fb+'" width="'+i_width+'" height="'+i_height+'" border="0">');
	}
 }
}

function setDefaultButton(e, buttonID)
{ 
      var button = document.getElementById(buttonID); 
      if (typeof button == 'object')
      { 
            if(navigator.appName.indexOf("Netscape")>(-1))
            { 
                  if (e.keyCode == 13)
                  { 
                        button.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
            { 
                  if (event.keyCode == 13)
                  { 
                        button.click(); 
                        return false; 
                  } 
            } 
      }
}

function addAllToSearchMiniCheckValidation(button, txtId,lblId,msgnotext,msg)

{

    var deger = document.getElementById(txtId).value; 

    var j=0;

    for(var i=0;i<deger.length;i++)

    {

        if(deger.charAt(i)!=" ")

        {

            j++;

        }

    }

    if(j==0)

    {

        document.getElementById(lblId).innerHTML = msgnotext;

        document.getElementById(button).disabled = true;

        return false;

    }

    else if(j < 3)

    {

        document.getElementById(lblId).innerHTML =msg;

        document.getElementById(button).disabled = true;

        return false;   

    }

    return true;

}

function controlAllToSearchMiniCheckValidation(button,txtId)

{

    document.getElementById(button).disabled = false;

}
