// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);	
}


var mColor = '#feaf39'
var mColor1 = '#feaf39'
var mColor2 = '#ff9900'
var mColor3 = '#FFFFFF'
var mColor4 = '#F1F1F1'
function mOvr(src, colorProfile) {		
	// if (!src.contains(event.fromElement)) {
	src.style.cursor = 'pointer';	 
	src.style.backgroundColor = colorProfile;
	//}
}

function mOut(src,clrIn) {
	//if (!src.contains(event.toElement)) {
	src.style.cursor = 'default';	
	src.style.backgroundColor = clrIn;
	//}
}

function menuActive(src,imgID){
	src.style.cursor = 'pointer';	 
	src.style.backgroundColor = '#feaf39';
	document.getElementById('imgID'+imgID).src="http://www.cypruspremier.com/images/icons/arrowP.gif";
	src.style.color = '#FFFFFF';
}

function menuPassive(src,imgID){
	src.style.cursor = 'default';	 
	src.style.backgroundColor = '';
	document.getElementById('imgID'+imgID).src="http://www.cypruspremier.com/images/icons/arrowA.gif";
	src.style.color = '';
}	



function OpenPrint(URL,name,features)
{
	window.open(URL,name,features)
}


function DivchangestateFAQ(SubjectID)
{
	if (document.all('subjdivFAQ'+SubjectID).style.visibility=='hidden')
 {
  document.all('subjdivFAQ'+SubjectID).style.visibility='visible';
  document.all('subjdivFAQ'+SubjectID).style.display='';  
 }
 else
 {
  document.all('subjdivFAQ'+SubjectID).style.visibility='hidden';
  document.all('subjdivFAQ'+SubjectID).style.display='none';
  
 }
 
}

function changestateFAQ(tableID)
{
 if (document.all('answerFAQ'+tableID).style.visibility=='hidden')
 {
  document.all('imgFAQ'+tableID).src="http://www.cypruspremier.com/images/icons/arrowBesteDown.gif";
  document.all('answerFAQ'+tableID).style.visibility='visible';
  document.all('answerFAQ'+tableID).style.display='';  
 }
 else
 {
  document.all('answerFAQ'+tableID).style.visibility='hidden';
  document.all('answerFAQ'+tableID).style.display='none';
  document.all('imgFAQ'+tableID).src="http://www.cypruspremier.com/images/Icons/arrowBeste.gif";
 }

}

function viewWaiting()
{
 document.all('SearchDiv').style.visibility='hidden';
 document.all('SearchDiv').style.display='none';
  document.all('SearchDiv1').style.visibility='hidden';
 document.all('SearchDiv1').style.display='none';
 
 document.all('waitingDiv').style.visibility='visible';
 document.all('waitingDiv').style.display='block';
 form1.submit();
} 
function viewWaitingBos()
{
 document.getElementById('SearchDiv').style.visibility='hidden';
 document.getElementById('SearchDiv').style.display='none';
 document.getElementById('waitingDiv').style.visibility='visible';
 document.getElementById('waitingDiv').style.display='block';
}

// sol ve sag kenar hizalamak icin====================================================================================
	fixHeight=function(){ 
		// Declare and initialize variables
		var divs,contDivs,maxHeight,divHeight,d; 
		maxHeight=0; 
		contDivs=[];		
		divs=document.getElementsByTagName('div');		// get all <div> elements in the document 
		for(var i=0;i<divs.length;i++){				// for all divs...
			if(/\bfixheight\b/.test(divs[i].className)){	// find those with the class attribute 'fixheight'...
				 d=divs[i]; 
				 contDivs[contDivs.length]=d; 

				 // determine their height, defined as either offsetHeight or pixelHeight
				 if(d.offsetHeight){ divHeight=d.offsetHeight; }
				 else if(d.style.pixelHeight){ divHeight=d.style.pixelHeight; } 

				 // Keep track of the largest div height
				 maxHeight=Math.max(maxHeight,divHeight); 
				 //alert(maxHeight);
			} 
			
		} 

		// assign all divs the height of the tallest div
		for(var i=0;i<contDivs.length;i++){ 
		//contDivs[i].style.height=maxHeight-12 + "px"; 
			contDivs[i].style.height=maxHeight + "px"; 
		} 
	} 
	// Run fixheight on page load 
	/*window.onload=function(){ 
		if(document.getElementsByTagName){ fixHeight(); } 
	}*/

// ====================================================================================

function resizeImage(obj,size,wh){
	var cw=obj.offsetWidth;
	var ch=obj.offsetHeight;
	if(cw>=ch){
		per=Math.round(size/cw*100);
	}else{
		per=Math.round(size/ch*100);
	}
	obj.style.width=Math.round(cw*per/100)+"px";
	obj.style.height=Math.round(ch*per/100)+"px";
}
