﻿// JavaScript Document
var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
<!--
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}



function kontrol(){
    var hata=true;
	
	var epostasi = document.kariyer.email.value
	if  (hata==true)
	if ((epostasi.indexOf ('@',0) == -1) || (epostasi.indexOf('.',0) == -1) || (epostasi.indexOf(' ',0) != -1) || (epostasi.length<6) || epostasi.indexOf ('@',0) != epostasi.lastIndexOf ('@')) {
        document.getElementById('durumemail').style.display='';  hata=false;
        }
	else 	
		 document.getElementById('durumemail').style.display='none'; 
		 
	
	var tckontrol,toplam1,toplam2,toplam3,toplam4; 
 	tcno = document.kariyer.tc.value; 
	
	toplam = Number(tcno.substring(0,1)) + Number(tcno.substring(1,2)) + Number(tcno.substring(2,3)) + Number(tcno.substring(3,4)) + Number(tcno.substring(4,5)) + Number(tcno.substring(5,6)) + Number(tcno.substring(6,7)) + Number(tcno.substring(7,8)) + Number(tcno.substring(8,9)) + Number(tcno.substring(9,10)); 
	toplam1 = Number(tcno.substring(0,1)) + Number(tcno.substring(2,3)) + Number(tcno.substring(4,5)) + Number(tcno.substring(6,7)) + Number(tcno.substring(8,9)); 
	toplam2 = Number(tcno.substring(1,2)) + Number(tcno.substring(3,4)) + Number(tcno.substring(5,6)) + Number(tcno.substring(7,8)); 
	toplam4=(toplam1*7);
	toplam5=toplam4-toplam2;
	toplam3=(toplam5%10);
	if (toplam3==tcno.substring(9,10))
		{
			strtoplam = String(toplam); 
			onunbirlerbas = strtoplam.substring(strtoplam.length, strtoplam.length-1); 
			if(onunbirlerbas == tcno.substring(10,11)) 
			{ 
				document.getElementById('durumtc').style.display='none'; 
			} 
			else{ 
				document.getElementById('durumtc').style.display='';  hata=false;
			} 
		}
	else
		{
			document.getElementById('durumtc').style.display='';  hata=false;
		}	
		
		 
	if (document.kariyer.ad.value.length<2)
	{ document.getElementById('durum').style.display=''; hata=false;}
	if (document.kariyer.ad.value.length>2)
	{ document.getElementById('durum').style.display='none';}
	
	if (document.kariyer.soyad.value.length<2)
	{ document.getElementById('durumsoyad').style.display='';  hata=false;}
	
	if (document.kariyer.soyad.value.length>2)
	{ document.getElementById('durumsoyad').style.display='none'; }
	
	
	if (document.kariyer.fdosya.value=='')
	{ document.getElementById('durumfdosya').style.display='';  hata=false;}
	
		
	if (document.kariyer.fdosya.value!='')
	{ 
		var nokta =document.kariyer.fdosya.value
		var temp = new Array();
		temp = nokta.split('.');
		
		if ((temp[1] != "doc") || (temp[1] != "docx") || (temp[1] != "pdf"))
		{document.getElementById('durumfdosya').style.display='';  hata=false;}
		if ((temp[1] == "doc") || (temp[1] == "docx") || (temp[1] == "pdf"))
		{document.getElementById('durumfdosya').style.display='none'; hata=true;}
	}
	
	if (document.kariyer.ulasma.value=='')
	{ document.getElementById('durumulasma').style.display='';  hata=false;}
	
	if (document.kariyer.ulasma.value!='')
	{ document.getElementById('durumulasma').style.display='none'; }
 
  return hata;
}

function satiskontrol(){
 var hata=true;	
	
	var epostasi = document.satis.email.value
	if  (hata==true)
	if ((epostasi.indexOf ('@',0) == -1) || (epostasi.indexOf('.',0) == -1) || (epostasi.indexOf(' ',0) != -1) || (epostasi.length<6) || epostasi.indexOf ('@',0) != epostasi.lastIndexOf ('@')) {
        document.getElementById('durumemail').style.display='';  hata=false;
        }
	else 	
		 document.getElementById('durumemail').style.display='none'; 
	
	if (document.satis.ad.value.length<2)
	{ document.getElementById('durum').style.display=''; hata=false;}
	if (document.satis.ad.value.length>2)
	{ document.getElementById('durum').style.display='none';}
	
	if (document.satis.soyad.value.length<2)
	{ document.getElementById('durumsoyad').style.display=''; hata=false;}
	if (document.satis.soyad.value.length>2)
	{ document.getElementById('durumsoyad').style.display='none';}
	
	if (document.satis.sirketad.value.length<2)
	{ document.getElementById('durumsirketad').style.display=''; hata=false;}
	if (document.satis.sirketad.value.length>2)
	{ document.getElementById('durumsirketad').style.display='none';}
	
	if (document.satis.faaliyetalani.value.length<2)
	{ document.getElementById('durumfaaliyetalani').style.display=''; hata=false;}
	if (document.satis.faaliyetalani.value.length>2)
	{ document.getElementById('durumfaaliyetalani').style.display='none';}
	
	if (document.satis.ulasma.value.length<2)
	{ document.getElementById('durumulas').style.display=''; hata=false;}
	if (document.satis.ulasma.value.length>2)
	{ document.getElementById('durumulas').style.display='none';}
	
	if (!document.satis.data.checked || !document.satis.dosya.checked || !document.satis.media.checked || !document.satis.icerik.checked)
	{ document.getElementById('durumhizmet').style.display=''; hata=false;}
	if (document.satis.data.checked || document.satis.dosya.checked || document.satis.media.checked || document.satis.icerik.checked)
	{ document.getElementById('durumhizmet').style.display='none'; hata=true;}	
	
  return hata;	
}


function hide(divID)
    {
    document.getElementById(''+divID+'').style.display = 'none';
    }
 
 
function displayCatDiv(divID)
    {
    document.getElementById(''+divID+'').style.display = 'block';
    }
 
 
 
function openWin( windowURL, windowName, windowFeatures )
	{
	window.open( windowURL, windowName, windowFeatures ) ;
	} 
 
 function displayDiv(divID)
	{
	hide('tits0-spot');hide('tits0-imaj');
	hide('tits1-spot');hide('tits1-imaj');
	hide('tits2-spot');hide('tits2-imaj');
	hide('tits3-spot');hide('tits3-imaj');
	hide('tits4-spot');hide('tits4-imaj');
	hide('tits5-spot');hide('tits5-imaj');
	hide('tits6-spot');hide('tits6-imaj');
	hide('tits7-spot');hide('tits7-imaj');
	hide('tits8-spot');hide('tits8-imaj');
	hide('tits9-spot');hide('tits9-imaj');
	hide('tits10-spot');hide('tits10-imaj');
	
	document.getElementById('tits'+divID+'-spot').style.display = 'block';
	document.getElementById('tits'+divID+'-imaj').style.display = 'block';
	}

