var phone_image = 1;
var letter_image = 0;

function change_phone_image()
{
	if(phone_image == 0){
		phone_image = 1;
		document.getElementById('phone_image').src = "/images/ctr/tel_kir.png";
		if(letter_image == 1) document.getElementById('communucation_type').value = "Farketmez";
		else document.getElementById('communucation_type').value = "Telefon";
	}
	else {
		phone_image = 0;
		document.getElementById('phone_image').src = "/images/ctr/tel_gri.png";
		if(letter_image == 1) document.getElementById('communucation_type').value = "Email";
		else document.getElementById('communucation_type').value = "";
	}
}

function change_mail_image()
{
	if(letter_image == 0){
		letter_image = 1;
		document.getElementById('letter_image').src = "/images/ctr/leter_kir.png";
		if(phone_image == 1) document.getElementById('communucation_type').value = "Farketmez";
		else document.getElementById('communucation_type').value = "Email";
	}
	else {
		letter_image = 0;
		document.getElementById('letter_image').src = "/images/ctr/letter_gri.png";
		if(phone_image == 1) document.getElementById('communucation_type').value = "Telefon";
		else document.getElementById('communucation_type').value = "";
	}
}


function start_banner(){
	setInterval("get_course_for_banner('up','slide')",7000);
}
function stop_slide(){
	banner_motion = 0;
}

function course_item_over(id){
	document.getElementById(id).className='document over'; 
}

function course_item_out(id){
	document.getElementById(id).className='document'; 
}

function course_detail_educator_over(id){
	document.getElementById(id).className='item over'; 
}

function course_detail_educator_out(id){
	document.getElementById(id).className='item'; 
}

function search_result_item_over(id){
	document.getElementById(id).className='search_result over'; 
}

function search_result_out(id){
	document.getElementById(id).className='search_result'; 
}

function article_list_item_over(id){ document.getElementById(id).className='article_item over';}
function article_list_item_out(id){ document.getElementById(id).className='article_item';}

function is_numeric(sText){
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}

function numbersonly(e) {
	var unicode=e.charCode? e.charCode : e.keyCode;
	if (unicode!=8){
		if (unicode<48||unicode>57) return false;
		else return true;
	}
}

function email_validate(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
}