function jumpTo(combo)
	{
		if (document.getElementById(combo).value!='')
			{
				window.location=document.getElementById(combo).value;
			}
	}

function reklamfilmi()
	{
		window.location='/hakkimizda/reklamfilmimiz.php';
	}


	
	
function checkCCForm(formName)
{
	var formValid=true;
	var formValidEmail=true;
	var errMsg='Lütfen ';
	var errMsgPlus='';
	if (formName.name.value=='') {formValid=false;errMsg+='isminizi, ';}
	if (formName.email.value=='') {
		formValid=false;errMsg+='e-posta adresinizi, ';
		}
	else if (!validateEmail(formName.email.value))
		{formValidEmail=false;errMsgPlus='e-posta adresinizi kontrol ediniz.';}
			
	if (formName.metin.value=='') {formValid=false;errMsg+='mesajynyzy, ';}	
	errMsg=errMsg.substr(0,errMsg.length-2)+' giriniz';
	if (formValid)
	{
		formName.submit();
	}
	else 
	{
		if (formValidEmail)
		{
			alert(errMsg+'.');
		}
		else 
		{
			alert(errMsg+'\nve '+errMsgPlus);
		}
	}
}



var req = new Array();


function retrieveURL(reqnumber,url,afteraction,failsafe) {
	if (url != "") {
		
	  if (window.XMLHttpRequest) { // Non-IE browsers
		req[reqnumber] = new XMLHttpRequest();
		if (afteraction!='')
		{req[reqnumber].onreadystatechange = eval(afteraction);}
		try {
		  req[reqnumber].open("GET", url, true);
		} catch (e) {
		  alert(e);
		}
		req[reqnumber].send(null);
	  } else if (window.ActiveXObject) { // IE
		req[reqnumber] = new ActiveXObject("Microsoft.XMLHTTP");
		if (req[reqnumber]) {
			if (afteraction!='')
			{req[reqnumber].onreadystatechange = eval(afteraction);}
		  req[reqnumber].open("GET", url, true);
		  req[reqnumber].send();
		}
	  }
	}
	else {
		eval(failsafe);
	}
}


function getNewestPool()
{
	retrieveURL(1,'/inc/anket-in.php','showPool','clearPool()');	
}

function pushAnswer(soru,cevap)
{
	retrieveURL(2,'/inc/anket-out.php?q=' + soru + '&a='+ cevap ,'showPoolResult','clearPool()');	
}

function showPoolResult()
{
	if ( req[2].readyState != 4 ) return ;
	document.getElementById("anketinside").innerHTML = req[2].responseText;
}


function clearPool()
{
	document.getElementById("anketinside").innerHTML = '';
}


function showPool()
{
	if ( req[1].readyState != 4 ) return ;
	document.getElementById("anketinside").innerHTML = req[1].responseText;
}

function anketekatil(formName)
{
	haveThis=-1;
	for (i=0;i<formName.cevap.length;i++)
	{
		if (formName.cevap[i].checked)
		{haveThis=i;}
	}
	if (haveThis<0)
	{
		alert('Ankete katılmak için seçeneklerden birini işaretlemeniz gerekmektedir.');
	}
	else
	{
		pushAnswer(formName.soru.value,formName.cevap[haveThis].value);
	}
}



// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)



function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
	var latestFlashVersion = 9;
   var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}
	return flashVersion;
}

flashVersion_DONTKNOW = -1;

var requiredVersion = 6;

function makeFlash(id,w,h,src,wmode,bg,fvar,mAlign)
	{

	if (flashVersion ==0)
		{flashVersion = getFlashVersion();}
	if (flashVersion >= requiredVersion)
		{	
			
			document.writeln('<object id="'+id+'" width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">');
			document.writeln('<param name="movie" value="'+src+'"><param name="wmode" value="'+wmode+'"><param name="bgcolor" value="'+bg+'"><param name="FlashVars" value="'+fvar+'">');
			if (mAlign!='') {document.write('<param name="sAlign" value="'+mAlign+'">');}
			document.writeln('<embed name="'+id+'" src="'+src+'" width="'+w+'" height="'+h+'" flashvars="'+fvar+'" wmode="'+wmode+'" bgcolor="'+bg+'" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"');
			if (mAlign!='') {document.write('salign="'+mAlign+'"');}			
			document.write('></embed>');
			document.writeln('</object>');

	}
	}


function validateEmail(fieldEmail) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    if (! fieldEmail.match(re)) {
        return (false);
    }
    return(true);
}
