//Smart Folding Menu tree- 

function Browser() {
		var b=navigator.appName;
		if (b=="Netscape") this.b="ns";
		else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
		else if (b=="Microsoft Internet Explorer") this.b="ie";
		if (!b) alert('Unidentified browser./nThis browser is not supported,');
		this.version=navigator.appVersion;
		this.v=parseInt(this.version);
		this.ns=(this.b=="ns" && this.v>=4);
		this.ns4=(this.b=="ns" && this.v==4);
		this.ns6=(this.b=="ns" && this.v==5);
		this.ie=(this.b=="ie" && this.v>=4);
		this.ie4=(this.version.indexOf('MSIE 4')>0);
		this.ie5=(this.version.indexOf('MSIE 5')>0);
		this.ie55=(this.version.indexOf('MSIE 5.5')>0);
		this.ie6=(this.version.indexOf('MSIE 6')>0);
		this.opera=(this.b=="opera");
		this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
		this.def=(this.ie||this.dom); // most used browsers, for faster if loops
		var ua=navigator.userAgent.toLowerCase();
		if (ua.indexOf("win")>-1) this.platform="win32";
			else if (ua.indexOf("mac")>-1) this.platform="mac";
		else this.platform="other";
	}
	is = new Browser();

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("DIV")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(img/open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(img/fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function PopWin2(url,p_width,p_height){
		KopWin = window.open("","","toolbar=0,width=" + p_width + ",height=" + p_height + ",location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=0,copyhistory=0"); 
		KopWin.location.href = url;
		KopWin.focus();
	}

function PopWin3(url,p_width,p_height){
		KopWin = window.open("","","toolbar=1,width=" + p_width + ",height=" + p_height + ",location=1,directories=1,status=1,scrollbars=1,menubar=1,resizable=1,copyhistory=1"); 
		KopWin.location.href = url;
		KopWin.focus();
	}
	
function popSimple(url,p_width,p_height) {
	popWin = window.open("","asme","toolbar=0,width=" + p_width + ",height=" + p_height + ",location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,copyhistory=0"); 
	popWin.location.href = url;
	popWin.focus();
}

function popNews(url,scrollbars){
	if(scrollbars){
		popWin = window.open("","news","toolbar=0,width=300,height=455,location=0,directories=0,status=0,scrollbars="+scrollbars+",menubar=0,resizable=0,copyhistory=0"); 
	}else{
		popWin = window.open("","news","toolbar=0,width=300,height=455,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,copyhistory=0"); 
	}

		popWin.location.href = url;
		popWin.focus();
}





function checkSearch() {
	txt=document.forms['arama_form'].keyword.value;
	if (txt.length<3) {
		alert('Arama için en az üç harfli bir sözcük girmeniz gerekmektedir.');
		return false;
	} else {
		return true;
	}
}

function checkSearch2() {
	txt=document.forms['arama_form'].keyword.value;
	if (txt.length<3) {
		alert('Please enter at least three characters.');
		return false;
	} else {
		return true;
	}
}
