
function changeColor(colorFieldName){
//alert(colorFieldName);
  var TDfieldName = colorFieldName + "TD";
  var fieldColor = document.getElementById(''+ colorFieldName+'').value;
	var fieldLenght = fieldColor.length;
 
  if(fieldLenght == 6){
	    document.getElementById(''+ TDfieldName +'').style.backgroundColor = fieldColor;
	}
}

function ciktinizMiKardes (){
  alert('Ziyaretiniz icin tesekkür ediyoruz!\n Yine bekleriz...');
}



function positionit(){
			if(direction == 'ltr'){		
			var siteWidth = '{siteWidth}';
			//alert(siteWidth);
		 var Hoffset=((document.body.clientWidth*15)/100)-10;
		  if(screen.width>800){
		   var widthneyse = ((document.body.clientWidth*85)/100)-(Hoffset);
		  }else{
		   var widthneyse = document.body.clientWidth;
		  }
				
			 if(document.body.clientWidth > 850){
				  //document.getElementById('siteRightAdvertising').style.left=document.body.clientWidth-(Hoffset);
				  document.getElementById('siteRightAdvertising').style.left=document.body.clientWidth-(Hoffset);
						document.getElementById('siteRightAdvertising').style.top=document.body.scrollTop+Voffset;
				  document.getElementById('siteRightAdvertising').style.display='inline';
			 }else if(document.body.clientWidth<=850){
				  document.getElementById('siteRightAdvertising').style.left=790;
						document.getElementById('siteRightAdvertising').style.top=document.body.scrollTop+Voffset;
			   document.getElementById('siteRightAdvertising').style.visibility='visible';
			 }
	 
	 
	 
	 }else{
	 		    if(screen.width>800){
						 var Hoffset = document.body.clientWidth-10;
		     var widthneyse = ((document.body.clientWidth)-(Hoffset));
		    }else{
		     var widthneyse = 0;
		    }
			 if(document.body.clientWidth > 900){
				  //document.getElementById('siteRightAdvertising').style.left=document.body.clientWidth-(Hoffset);
				  document.getElementById('siteRightAdvertising').style.left=document.body.clientWidth-(Hoffset);
						//alert(document.getElementById('siteRightAdvertising').style.left);
						document.getElementById('siteRightAdvertising').style.top=document.body.scrollTop+Voffset;
				  document.getElementById('siteRightAdvertising').style.display='inline';
			 }else if(document.body.clientWidth>=870 && document.body.clientWidth<=900){
				  document.getElementById('siteRightAdvertising').style.left=1;
						document.getElementById('siteRightAdvertising').style.top=document.body.scrollTop+Voffset;
			   document.getElementById('siteRightAdvertising').style.visibility='visible';
			 }else if(document.body.clientWidth<870){
			   document.getElementById('siteRightAdvertising').style.display='none';
			 }
	 }
}


 //Asagidakii iki function ile birlikte kullanilirsa pencere her zaman tam ortada oluyor!!!!
function newsWindowParameters(){
   Height = window.screen.height-100 ;
   Width = 580;
	Left = (window.screen.width - Width) / 2;
	Top = ((window.screen.height - Height) / 2);
	 return "width="+Width+",height="+Height+",left="+Left+",top="+Top+",scrollbars=yes,resizable=yes"; 
} 

function makeWindowForNews(url,Name){
 Name = window.open(url,Name,newsWindowParameters());
 Name.focus();
}


function makeWindow(url,Name,Width,Height,Scrollbars,Resizable){
 Name = window.open(url,Name,winParam(Width,Height,Scrollbars,Resizable));
 Name.focus();
}


function winParam(Width,Height,Scrollbars,Resizable){
	Left = (window.screen.width - Width) / 2;
	Top = (window.screen.height - Height) / 2;
	return "width="+Width+",height="+Height+",left="+Left+",top="+Top+",scrollbars="+Scrollbars+",resizable="+Resizable+"";
}

 // onclick="MakeWindow('referenzen.html');this.blur()"
 
 // Yukaridaki iki function ile birlikte kullanilirsa pencere her zaman tam ortada oluyor!!!!

function popWindow_hp(theURL,vars,winName,htmlName,features) { 
	eval(winName+"=window.open('"+theURL+'?'+vars+"','"+htmlName+"','"+features+"')");
	if (window.focus)	eval(winName + ".focus()");
} 

function hideVisible3(whic_one){
				 if (whic_one==''){ whic_one = 'title';}
	 //	var elem=document.getElementById(whic_one);
    if (document.getElementById(whic_one).style.visibility == 'hidden') {	
	     document.getElementById(whic_one).style.visibility = 'visible';
	   } else {
	     document.getElementById(whic_one).style.visibility = 'hidden';     
	   }
}

function hideVisible2(whic_one){
				 if (whic_one==''){ whic_one = 'title';}
	 //	var elem=document.getElementById(whic_one);
    if (document.getElementById(whic_one).style.display == '') {	
	     document.getElementById(whic_one).style.display = 'none';
	   } else {
	     document.getElementById(whic_one).style.display = '';     
	   }
}

function hideVisible(whic_one){
				 if (whic_one==''){ whic_one = 'title';}
	 	var elem=document.getElementById(whic_one);
    if (document.getElementById(whic_one).style.display == '') {	
	     document.getElementById(whic_one).style.display = 'none';
					document.images[whic_one+'x'].src = 'images/head_img/plusTrans.gif';
	   } else {
	     document.getElementById(whic_one).style.display = '';
					document.images[whic_one+'x'].src =  'images/head_img/minusTrans.gif';  
	   }
}
function hideVisibleY(whic_one){
				 if (whic_one==''){ whic_one = 'title';}
	 	var elem=document.getElementById(whic_one);
    if (document.getElementById(whic_one).style.display == '') {	
	     document.getElementById(whic_one).style.display = 'none';
					document.images[whic_one+'y'].src = 'images/head_img/plusTrans.gif';
	   } else {
	     document.getElementById(whic_one).style.display = '';
					document.images[whic_one+'y'].src =  'images/head_img/minusTrans.gif';  
	   }
}
function hideVisibleNoImg(whic_one){
	var elem = document.getElementById(whic_one);
			if(elem.style.display == 'inline') {	
	     elem.style.display = 'none';
	   } else {
	     elem.style.display = 'inline';
	   }
}




function openAudio(URL){
 open (URL,"","width=300,height=400,top=100, left=200,scrollbars=no,resizable=no,status=no,menubar=no,toolbar=no,location=no")
}
function openVideo(URL){
 open (URL,"","width=400,height=300,top=100, left=200,scrollbars=no,resizable=no,status=no,menubar=no,toolbar=no,location=no")
}
function openPhotoAlben(URL){
 open (URL,"","width=550,height=500,top=0, left=0,scrollbars=yes,resizable=yes,status=no,menubar=no,toolbar=no,location=no");
}


function OpenGaleri(lnk){
open (lnk,"","height=width=400,height=300,scrollbars=no,resizable=no,status=no,menubar=no,toolbar=no,location=no");
}


//One time wait, then Print
  var waitTime = 300;
   function printDokument(){
    brovserVersion = parseInt(navigator.appVersion)
     if(brovserVersion >= 4) 
      window.print()
      exit();
		 setTimeout('printDokument()',waitTime);		
   }
a = new Date();
a = a.getTime();

function closeForm(){
  this.close();
}

function searchButtonDisable() {
  var form = document.form_search;
  if (form.elements["author_name"].value!="" || (form.elements["search_words"].value.length < 3) || (form.elements["search_words"].value.length > 100))
    form.elements["searchButton"].disabled=true;
  else
   form.elements["searchButton"].disabled=false;
}

function saveHarddisc(){
   if (this.document.execCommand){
    this.document.execCommand("SaveAs",false,".txt");
  }
}

function search_date_control_home(){
		var alert_msg;
		var blank_field_message ='{blank_field_message}';
		var search_words_home = document.form_search_home.search_words_home.value;
		var searchButton = document.form_search_home.searchButton.value;
	if(search_words_home ==''){
			alert_msg=(blank_field_message);
			alert(alert_msg);
			return;	
	}else{ 
		document.form_search_home.submit(); 
//viewSearchResult()
	}
}

function search_words_home_onkeyup_home() {
   var form = document.form_search_home;
/*
  if(form.elements["search_words_home"].value.length == 0){
		form.elements["searchButton"].disabled=false;
	  form.elements["searchButton"].value='Tüm Haberler / Ara';
  } else if((form.elements["search_words_home"].value.length > 0) && (form.elements["search_words_home"].value.length < 3)){
 	  form.elements["searchButton"].disabled=true;
	  form.elements["searchButton"].value='Ara';
	}else{
		 form.elements["searchButton"].disabled=false;
	   form.elements["searchButton"].value='Ara';
	}	
*/

  if(form.elements["search_words_home"].value.length == 0){
		 form.elements["searchButton"].style.display='none';
	   form.elements["allNews"].style.display='inline';
  } else if((form.elements["search_words_home"].value.length > 0) && (form.elements["search_words_home"].value.length < 3)){
		 form.elements["searchButton"].style.display='inline';
	   form.elements["allNews"].style.display='none';
	   form.elements["searchButton"].disabled=true;
	}else{
		 form.elements["searchButton"].style.display='inline';
	   form.elements["allNews"].style.display='none';
		 form.elements["searchButton"].disabled=false;
	}	

	
}

 
function hideAdvertising(layerName){
  //var layerName;
  var lay = document.getElementById(layerName);
  lay.style.visibility = "hidden";
}

function showAdvertising(layerName){
  var lay = document.getElementById(layerName);
  lay.style.visibility = "visible";
  var winsize = document.body.clientWidth;
  var bbs2 = (winsize - 775)/2;
  bsize = 100 + bbs2;
  // lay.style.left = bboyut + "px";
}
function show(){
  if(document.form.year) document.form.year.style.visibility = 'visible';
	if(document.form.mon) document.form.mon.style.visibility = 'visible';
	if(document.form.day) document.form.day.style.visibility = 'visible'
	if(document.form.issueNumber) document.form.issueNumber.style.visibility = 'visible'
  if(document.titleAdvertising)document.titleAdvertising.style.visibility = 'visible';
}

function hide(){
  if(document.form.year) document.form.year.style.visibility = 'hidden';
	if(document.form.mon) document.form.mon.style.visibility = 'hidden';
	if(document.form.day) document.form.day.style.visibility = 'hidden'
	if(document.form.issueNumber) document.form.issueNumber.style.visibility = 'hidden'
  if(document.titleAdvertising)document.titleAdvertising.style.visibility = 'hidden';
}

function show2(){
  if(document.form.year) document.form.year.style.visibility = 'visible';
	if(document.form.mon) document.form.mon.style.visibility = 'visible';
	if(document.form.day) document.form.day.style.visibility = 'visible'
	if(document.form.issueNumber) document.form.issueNumber.style.visibility = 'visible'
	if(document.nearLogoAdvertising)document.nearLogoAdvertising.style.visibility = 'visible';
  if(document.titleAdvertising)document.titleAdvertising.style.visibility = 'visible';
}

function hide2(){
  if(document.form.year) document.form.year.style.visibility = 'hidden';
	if(document.form.mon) document.form.mon.style.visibility = 'hidden';
	if(document.form.day) document.form.day.style.visibility = 'hidden'
	if(document.form.issueNumber) document.form.issueNumber.style.visibility = 'hidden'
	if(document.nearLogoAdvertising)document.nearLogoAdvertising.style.visibility = 'hidden';
  if(document.titleAdvertising)document.titleAdvertising.style.visibility = 'hidden';
}

var blnIsNS = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) >= 4) ? true : false;
var blnIsIE = (document.getElementById) ? true : false;
var blnIsMac= (navigator.appVersion.indexOf('Mac')!=-1) ? true : false;
var id_counter = 0;



function flashRollOver(strUrl,intWidth,intHeight,clickUrl,rawClickUrl,objectName,strMode){
	var objectName;
	var lclStrMode=(strMode==null)?"transparent":strMode;
	var tempStrUrl=(rawClickUrl!="http://")?strUrl+clickUrl:strUrl;

	strUrl=tempStrUrl;
	var lclStrBnrId = "Bnr_"+(id_counter++)
 	document.write("<div id='"+lclStrBnrId+"'></div>");
 	var lyr = document.getElementById(lclStrBnrId);
 	var position = (blnIsIE) ? '' : 'left:' + lyr.PageX + ';top:' + lyr.PageY;
	//alert(strUrl);
	var tmp;
	//'<OBJECT onmouseover="hide();" onmouseout="show();"'+
	tmp = ''+
	'<OBJECT name="'+objectName+'" id="'+objectName+'"'+
	' style="POSITION:absolute; z-index:1; ' + position + '"' +
	' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0/"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
	'>'+
	'<PARAM NAME="movie" VALUE="'+strUrl+'">'+
	'<PARAM NAME="quality" VALUE="high">'+
	'<PARAM NAME="wmode" VALUE="'+lclStrMode+'">'+
	'<embed'+
	' src="'+strUrl+'"'+
	' quality="high"'+
	' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"'+
	' type="application/x-shockwave-flash"'+
	' style="position:absolute; z-index:1; '+ position + '"' + 
	' wmode="'+lclStrMode+'"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	'></embed>'+
	'</OBJECT>';
	
	document.write(tmp);
}

function nearLogoAdvertising(strUrl,intWidth,intHeight,clickUrl,rawClickUrl,objectName,strMode){
	var objectName;
	var lclStrMode=(strMode==null)?"transparent":strMode;
	var tempStrUrl=(rawClickUrl!="http://")?strUrl+clickUrl:strUrl;

	strUrl=tempStrUrl;
	var lclStrBnrId = "Bnr_"+(id_counter++)
 	document.write("<div id='"+lclStrBnrId+"'></div>");
 	var lyr = document.getElementById(lclStrBnrId);
 	var position = (blnIsIE) ? '' : 'left:' + lyr.PageX + ';top:' + lyr.PageY;
	//alert(strUrl);
	var tmp;
	//'<OBJECT onmouseover="hide();" onmouseout="show();"'+
	tmp = ''+
	'<OBJECT name="'+objectName+'" id="'+objectName+'" onmouseover="hide();" onmouseout="show();"'+
	' style="POSITION:absolute; z-index:1; ' + position + '"' +
	' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0/"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
	'>'+
	'<PARAM NAME="movie" VALUE="'+strUrl+'">'+
	'<PARAM NAME="quality" VALUE="high">'+
	'<PARAM NAME="wmode" VALUE="'+lclStrMode+'">'+
	'<embed'+
	' src="'+strUrl+'"'+
	' quality="high"'+
	' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"'+
	' type="application/x-shockwave-flash"'+
	' style="position:absolute; z-index:1; '+ position + '"' + 
	' wmode="'+lclStrMode+'"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	'></embed>'+
	'</OBJECT>';
	
	document.write(tmp);
}


function overLogoAdvertising(strUrl,intWidth,intHeight,clickUrl,rawClickUrl,objectName,strMode){
	var objectName;
	var lclStrMode=(strMode==null)?"transparent":strMode;
	var tempStrUrl=(rawClickUrl!="http://")?strUrl+clickUrl:strUrl;

	strUrl=tempStrUrl;
	var lclStrBnrId = "Bnr_"+(id_counter++)
 	document.write("<div id='"+lclStrBnrId+"'></div>");
 	var lyr = document.getElementById(lclStrBnrId);
 	var position = (blnIsIE) ? '' : 'left:' + lyr.PageX + ';top:' + lyr.PageY;
	//alert(strUrl);
	var tmp;
	//'<OBJECT onmouseover="hide();" onmouseout="show();"'+
	tmp = ''+
	'<OBJECT name="'+objectName+'" id="'+objectName+'" onmouseover="hide2();" onmouseout="show2();"'+
	' style="POSITION:absolute; z-index:1; ' + position + '"' +
	' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0/"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
	'>'+
	'<PARAM NAME="movie" VALUE="'+strUrl+'">'+
	'<PARAM NAME="quality" VALUE="high">'+
	'<PARAM NAME="wmode" VALUE="'+lclStrMode+'">'+
	'<embed'+
	' src="'+strUrl+'"'+
	' quality="high"'+
	' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"'+
	' type="application/x-shockwave-flash"'+
	' style="position:absolute; z-index:1; '+ position + '"' + 
	' wmode="'+lclStrMode+'"'+
	' width="'+intWidth+'" height="'+intHeight+'"'+
	'></embed>'+
	'</OBJECT>';
	
	document.write(tmp);
}
function parseNavigation(ob) {
// created by joe crawford october 2002
// http://artlung.com/lab/scripting/dropdown-only-some-new-window/
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

    if (targetWindow!=='') {
        // if a new Window name is specified, then it will
    				// open in a new Window.
        window.open(targetURL,targetWindow,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=550');
    				// if we open a new window, then we have to re-set
    				// the select box to the first option
    				// which should have no value
    				ob.selectedIndex = 0;
    } else {
        // or else it will open in the current window        
    				window.open(targetURL,'_top')
    }
}

 function voteControl(){
    var option_id = '';
   for (i=0; i<self.document.poll_$poll_id.option_id.length; i++) {
     if(self.document.poll_$poll_id.option_id[i].checked == true) {
       option_id = self.document.poll_$poll_id.option_id[i].value;
       break;
     }
   }
    if (option_id==0) alert ("Option?!");
 }
 
   function kaydetButtonsDisable(){
	 	 if (form.elements["submit1"])		form.elements["submit1"].disabled = true;
			if (form.elements["submit2"])		form.elements["submit2"].disabled = true;
			if (form.elements["submit3"])		form.elements["submit3"].disabled = true;
			if (form.elements["submit4"])	 form.elements["submit4"].disabled = true;
			document.form.submit(); 
	}
	
function titleSpotsDisable(){
  if(form.elements["overtitle"]) form.elements["overtitle"].disabled = true;
  if(form.elements["title"])     form.elements["title"].disabled					= true;
  if(form.elements["spot_1"]) 			form.elements["spot_1"].disabled				= true;
	if(form.elements["spot_2"]) 			form.elements["spot_2"].disabled				= true;
	if(form.elements["text"]) 					form.elements["text"].disabled						= true;
	if (form.elements["submit4"])	 form.elements["submit4"].disabled = true;
	document.form.submit(); 
}
										

	
function buttonChangeO(hareket){
  var barButtonO=window.event.srcElement;
  if(barButtonO.tagName=="IMG"){
    switch(hareket){
     case "outO"  :barButtonO.className = "outO"  ;break;
			case "outHeadO"  :barButtonO.className = "outHeadO"  ;break;
     case "upO"   :barButtonO.className = "upO"   ;break;
     case "overO" :barButtonO.className = "overO" ;break;
     case "downO" :barButtonO.className = "downO" ;break;
   }
 }
}


function saveAsText(){
   if (this.document.execCommand){
    this.document.execCommand("SaveAs","false",".txt");
  }
}



/*
//contextmenu
			var parameters = '';
			var overmenu=false;
			var nombreDiv;
			var esNS = document.getElementById&&!document.all
			function ocultar(DivName){
				var DivName = document.getElementById("DivActiveDiv").value;
				if( overmenu == false ){
					if (DivName!=''){
						document.getElementById(DivName).style.visibility = "hidden";
					}
				}else{
					nombreDiv=DivName;
					setTimeout('document.getElementById(nombreDiv).style.visibility = "hidden";',200);
					return true;
				}
			}
			function mostrar(DivName,e, param) {
				parameters=param;
				Da= document.getElementById("DivActiveDiv");
				if(Da.value!=""){
					ocultar(Da.value);
				}
				Da.value = DivName;
				
				if (window.innerHeight){
					  posY = window.pageYOffset
					  posX = window.pageXOffset
				}else if (document.documentElement && document.documentElement.scrollTop){
					posY = document.documentElement.scrollTop
					posX = document.documentElement.scrollLeft
				}else if (document.body){
					  posY = document.body.scrollTop
					  posX = document.body.scrollLeft
				}
				if (esNS){
					mouseX=e.clientX+posX
					mouseY=e.clientY+posY
					document.getElementById(DivName).style.left = mouseX+'px'
					document.getElementById(DivName).style.top  = mouseY+'px'
				}else{
					document.getElementById(DivName).style.pixelLeft = event.clientX+posX
					document.getElementById(DivName).style.pixelTop = event.clientY+posY
				}
				document.getElementById(DivName).style.visibility = "visible";
				return false
			}
			function process(action, type){
				if(type=='J'){
					eval(action);
				}else{
					window.location=action+parameters;
				}
			}

			if ( typeof window.onload == 'function' ) {
				old_onload = window.onload;
				window.onload = function(){
					old_onload();
					if ( typeof document.body.onmousedown == 'function' ) {
						old_mousedown = document.body.onmousedown;
						document.body.onmousedown = function(){ old_mousedown(); ocultar(); }
					}else{
						document.body.onmousedown = ocultar;
					}
				}//function
			}else{
				 window.onload = function(){
					  if ( typeof document.body.onmousedown == 'function' ) {
						   old_mousedown = document.body.onmousedown;
						   document.body.onmousedown = function(){ old_mousedown(); ocultar(); }
					  }else{
						   document.body.onmousedown = ocultar;
					  }
			}//funtion
	}
*/	