var mesajvar=false;
var messageCallBack=function(){}
var messageCallBackPrms="";


function getZaman(){
  now = new Date();
  hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();
  gun = now.getDate();
  ay = now.getMonth()+1;
  yil = now.getFullYear();

  hour = (hour<10?"0"+hour:hour);
  min = (min<10?"0"+min:min);
  sec = (sec<10?"0"+sec:sec);  

  gun = (gun<10?"0"+gun:gun);
  ay = (ay<10?"0"+ay:ay);
  

  	return gun+"."+ay+"."+yil+" "+hour + ":" + min + ":" + sec
 }


function checkEmail(fData)
 {
	var reg = new RegExp("^[0-9a-zA-Z.-_]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$");
    return reg.test(fData);
  }
redtomain=function (prm){
	window.location.href="/"+prm;	
}
 function checkUsername(fData)
 {
	var reg = new RegExp("^[0-9a-zA-Z]+$");
    return reg.test(fData);
 }
 
 function checkDate(day,month,year){
	var dteDate;
	dteDate=new Date(year,month-1,day);
	return ((day==dteDate.getDate()) && (month==dteDate.getMonth()+1) && (year==dteDate.getFullYear()));
}

  function checkMinLength(fData)
 {	
    return (fData.length>2 && fData.length<21)
 }
 
 
 function submitForm(url,form,callBack){
	 
	 var parameters="";
	  for (var n=0; n < form.elements.length; n++) {
      parameters +="&"+form.elements[n].name+"="+escape(encodeURI(form.elements[n].value));
 	}
	  http_request = false;
	  stat=true;
      if (window.XMLHttpRequest) {
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html;charset=utf-8');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         //alert('Cannot create XMLHTTP instance');
		 callBack(false);
      } 


    http_request.onreadystatechange=function(){
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
			callBack(http_request.responseText);
         } else {
			
			 callBack(false);
         }
      } 
   }
		
    http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
	return;
}

function showmessage(message,type,callBack,prms){
	document.getElementById('messagediv').innerHTML=message;
	document.getElementById('lightboxdiv').style.display='';
	document.getElementById("messageicon").setAttribute("class", type);
	if(callBack!=""){
		messageCallBack=callBack;
		messageCallBackPrms=prms;
	}
	mesajvar=true;
	

	
}
function messageVisible(){
	if(document.getElementById('lightboxdiv').style.display=='none'){
		return false;
	} else {
		return true;	
	}
}

function closeMessage(){
	if(mesajvar){
		document.getElementById('lightboxdiv').style.display='none';
		mesajvar=false;	
		messageCallBack(messageCallBackPrms);
		messageCallBack=0;
	}
}


function goLite(bu)
{

   bu.style.backgroundColor = "#2888D8";
   bu.style.borderTopColor = "#2888D8";
   bu.style.borderBottomColor = "#2888D8";
   bu.style.borderLeftColor = "#1864D0";
   bu.style.borderRightColor = "#58A4E0";
}

function goDim(bu)
{
   bu.style.backgroundColor = "#2878C0";
   bu.style.borderTopColor = "#2878C0";
   bu.style.borderBottomColor = "#2878C0";
   bu.style.borderLeftColor = "#1858B8";
   bu.style.borderRightColor = "#508CC0";
}

function checkEnter(e,func,prm){
	var characterCode 
	if(e && e.which){
		e = e
		characterCode = e.which 
	}else{
		e = event
		characterCode = e.keyCode 
	}
	if(characterCode == 13){ 
		func(prm);
		return false
	} else{
		return true
	}
}


function writeflash(swfname,w,h,flashvars,wmode,flashid){

if(wmode==''){
	wmode='transparent';
}

if(flashid==''){
	flashid	='flmovie';
}

	return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+w+'" height="'+h+'" id="'+id+'" align="middle">	<param name="allowScriptAccess" value="sameDomain" />	<param name="allowFullScreen" value="false" />    <param name="flashvars" value="'+flashvars+'" />	<param name="movie" value="http://'+location.host+'/'+swfname+'" />	<param name="quality" value="high" />	<param name="wmode" value="'+wmode+'" />	<param name="bgcolor" value="#ffffff" />	<embed src="http://'+sitedomain+'/'+swfname+'" quality="high" scale="noscale" wmode="'+wmode+'" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="gamethmb" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" flashvars="'+flashvars+'" />	</object>';
}	



/*

// constants to define the title of the alert and button text.
var ALERT_TITLE = "Oops!";
var ALERT_BUTTON_TEXT = "Ok";

// over-ride the alert method only if this a newer browser.
// Older browser will see standard alerts
if(document.getElementById) {
	window.alert = function(txt) {
		createCustomAlert(txt);
	}
}

function createCustomAlert(txt) {
	// shortcut reference to the document object
	d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(ALERT_TITLE));

	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));
	msg.innerHTML = txt;
	
	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() { removeCustomAlert();return false; }

	
}

// removes the custom alert from the DOM
function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
*/