function tdmouseover(el) {
	el.style.color = "#ffffff";
	el.style.backgroundColor = "#fa4e9d";
}
function tdmouseout(el) {
	el.style.color = "#000000";
	el.style.backgroundColor = "#e2e2e2";
}


function changeclass(elem,newClass)
{

document.getElementById(elem+"-1-1").className='botton-top-left';
document.getElementById(elem+"-1-2").className='botton-top-center'; 
document.getElementById(elem+"-1-3").className='botton-top-right'; 

document.getElementById(elem+"-1").className='botton-left-center';
document.getElementById(elem+"-2").className='botton-center'; 
document.getElementById(elem+"-3").className='botton-right-center'; 
}

function changeclassBack(elem,newClass)
{

document.getElementById(elem+"-1-1").className='botton1-top-left';
document.getElementById(elem+"-1-2").className='botton1-top-center'; 
document.getElementById(elem+"-1-3").className='botton1-top-right'; 

document.getElementById(elem+"-1").className='botton1-left-center';
document.getElementById(elem+"-2").className='botton1-center'; 
document.getElementById(elem+"-3").className='botton1-right-center'; 
}

function verify(){
if(document.search.searchText.value==""){
alert("Please type name to search.");
document.search.searchText.focus();
return false;
}
else
return true;
}

function chk(){

if(document.form5.fname.value==""){
alert("Please Enter First Name.");
document.form5.fname.focus();
return false;
}
else
if(document.form5.lName.value==""){
alert("Please Enter Last Name.");
document.form5.lName.focus();
return false;
}
else
if(document.form5.cCountry.value==""){
alert("Please Select Country.");
document.form5.cCountry.focus();
return false;
}
else
if(document.form5.cSubject.value==""){
alert("Please Enter Subject.");
document.form5.cSubject.focus();
return false;
}
else
if(document.form5.cComments.value==""){
alert("Please Enter Comments.");
document.form5.cComments.focus();
return false;
}
else
return true;	
}

function checkUploadFile(obj)
{
   sfile=obj;
   sfile=sfile.toLowerCase();
   last=sfile.lastIndexOf('.');
   ext=sfile.substring(last+1);
   filetype="jpg,jpeg,gif,png";
   filetype=filetype.toLowerCase();
   ok=filetype.search(ext.toLowerCase())
   if(ok==-1)
   {
       alert("please upload picture with extensions:jpg,jpeg,gif,png!");
       return false;
   }
	else
	return true;
	
}	


function typeChk(){
	
	if(document.form3.uploadedfile.value =="" )
	{alert("Please Select A Picture.");
	document.form3.uploadedfile.focus();
	return false;}
	else{
		
	var uploaded=document.form3.uploadedfile.value;
	var result=checkUploadFile(uploaded);
	if(result==false){
	document.form3.uploadedfile.value = "";
	document.form3.uploadedfile.focus();
	return false;}
	else
	return true;
	
	
	}
}

function popUp(fullImagePath)
{
	var width = 800;
    var height = 600;
	var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
	//alert(title+fullImagePath);
	var url="rateName.php?"+fullImagePath;
	
	var attributes = "width=400, height=100, left="+left+",top="+top+", scrollbars=no, menubar=no, resizable=no, location=no, toolbar=no, status=no";
	
	window.open(url, "", attributes);
}


function popUps(title, fullImagePath)
{	
	var leftVal =(1000-(screen.width/2));
	var topVal = (250-(screen.height/2));
	var url="largeView.php?imageFullPath="+fullImagePath;
	var attributes = "width=400, height=400, left="+leftVal+", top="+topVal+", scrollbars=no,menubar=no,resizable=no,location=no,toolbar=no,status=no";
	
	window.open(url, "", attributes);
}

function alerted(text)
{
	var con = confirm(text);
	if(!con)
	{
		return false;
	}
	else 
	return true;
}
