function InitPage()
{
	var MaxHeight = screen.availHeight;
	var MaxWidth = screen.availWidth;
	var lstrip = document.getElementById("StripLeft");
	var bstrip = document.getElementById("StripBody");
	if(lstrip!=null) lstrip.style.height = MaxHeight - 150;
	if(bstrip!=null) bstrip.style.height = MaxHeight - 283;
	var link = document.getElementById("LinkItem12");
	if(link!=null)
	{ 
		link.style.color = "#FFF799";
		link.style.fontSize = "12";
		link.style.fontWeight = "bold";
	}
}

function gotoURL(URL)
{
	document.location = URL;
}

function ChangeIfrLocation(PageId)
{
	var i;
	for(i = 1;i< 12;i++)
	{
		var link = document.getElementById("LinkItem" + i);
		if(link!=null) link.style.color = "#BAE7F5";

	}
	link = document.getElementById("LinkItem12");
	if(link!=null)
	{ 
		link.style.color = "#FFF799";
		link.style.fontSize = "12";
		link.style.fontWeight = "bold";
	}

	var pagelink = document.getElementById("LinkItem" + PageId);
	var ifr = document.getElementById("ifrBody");
	if(pagelink!=null) pagelink.style.color = "White";
	if(ifr!=null) ifr.src = "IFrmFiles/SeaTerra-HTML" + PageId + ".Html";
}

function ChangeZoom(ItemId , Zoom)
{
	var zoomid = document.getElementById("Zoom" + ItemId);
	if(zoomid!=null)
	{
		switch(Zoom)
		{
			case 1:
				zoomid.src = "../Images/magnify_but_n.gif";
				break;
			case 0:
				zoomid.src = "../Images/magnify_but_r.gif";
				break;
		}
	}
}

function EnlargeFlash(FlashPath)
		{
			window.open("PicEnlarge.Html?PicPath=" + FlashPath + ".swf");
		}

function enlargeflash(FlashPath)
		{
			window.open("PicEnlarge.Html?PicPath=" + FlashPath + ".swf");
		}
		
function EnlargePic(PicturePath)
{
	document.URL = "PicEnlarge.Html?PicPath=" + PicturePath + ".gif";
}


function EnlargeBlock(block)
{
	document.URL = "PicEnlarge.Html?PicPath=" + block;
}

function openWin(pic_name) 
{
	if(pic_name=="freeTrip.gif")
	{
		InspectionTours();
	}else
	{
		var top, left
	
		top=10;
		left=100;
	
		window.open("big_pic.html?pic_name="+pic_name,"","width=400,height=400,resizable=1,scrollbars=1,top="+ top +",left="+ left )
	}
}
function openWinFlat(pic_name) 
{
	if(pic_name=="freeTrip.gif")
	{
		InspectionTours();
	}else
	{
		var top, left
	
		top=10;
		left=100;
	
		window.open("big_pic_flat.html?pic_name="+pic_name,"","width=400,height=400,resizable=1,scrollbars=1,top="+ top +",left="+ left )
	}
}

function openWinReg(pic_name) 
{
	
	var top, left

	top=10;
	left=100;

	window.open("big_pic_regular.html?pic_name="+pic_name,"","width=400,height=400,resizable=1,scrollbars=1,top="+ top +",left="+ left )
	
}


function drawMenu()
{
	drawBut("But_contact12");
//	drawBut("But_Home1");
	drawBut("But_esentepehp");
	drawBut("But_Esentepe2"); 
	drawBut("But_location3");
	drawBut("But_Inspec_Trips");
	drawBut("But_Testimonials");
	drawBut("But_AboutUs");

	//drawBut("But_siteplan4");
	//drawBut("But_BlockTypes5");
	//drawBut("But_Apartment6"); 
	//drawBut("But_Building7");
	//drawBut("But_Pricelist8"); 
	//drawBut("But_Architect9");
	//drawBut("But_VirtualTour10");
	//drawBut("But_Esentepe11");
	//drawBut("But_SitePhotos12");
	//drawBut("But_FAQ");
	//drawBut("But_PackageOptions");
	//drawBut("But_Investor");
	//drawBut("But_Forum_Esentepe");
	
	document.write("	<p align=\"center\" style=\"height:20px;\">&nbsp</p>\n");
	
	//drawImageLink("images/but_reserve.jpg","../SeaterraReserve");
	drawImageLink("images/but_bay.jpg","../SeaterraBay");
	//drawImageLink("images/esentepe_villas.jpg","../SeaterraVillas/");
	drawImageLink("images/but_marina.jpg","../northerncyprus-properties");
	//drawIso("images/iso_esentepe.gif");
}

function drawBut(butName)
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ")
	document.write(" WIDTH='160' HEIGHT='29' id='But_Home1' ALIGN=''>")
	document.write("<PARAM NAME=movie VALUE='Esentepe/buts/" + butName + ".swf'> <param name='wmode' value='transparent'> <PARAM NAME='quality' VALUE='high'> <PARAM NAME='bgcolor' VALUE='#FFFFFF'> <EMBED src='Esentepe/buts/" + butName + ".swf' wmode='transparent' quality='high' bgcolor='#FFFFFF'  WIDTH='160' HEIGHT='29' NAME='But_Home1' ALIGN='' ")
	document.write(" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED> ")
	document.write(" </OBJECT>")
}

function drawIso(image)
{
	document.write("	<p align=\"center\" >\n");
	document.write("		<img src='"+ image +"' border='0' >\n");
	document.write("	</p>\n");
	
}

function drawImageLink(image,sLink)
{
	document.write("	<p align=\"center\" >\n");
	document.write("		<a href='"+ sLink +"'><img src='"+ image +"' border='0'></a>\n");
	document.write("	</p>\n");
	
}

function GetLPic()
{
	return vLPic;
}
function SetLPic(sLPic)
{
	vLPic = sLPic;
}


function SetLocation(item)
{
	switch (item)
	{
		case "Esentepe" : window.location.href="index.html";
						break;
		case "Location" : window.location.href="Location.html";
						break;
		case "SitePlan" : window.location.href="SitePlan.html";
						break;
		case "BlockTypes" : window.location.href="ApartmentBlock.html";
						break;
		case "ApartmentPlans" : window.location.href="ApartmentPlans.html";
						break;									
		case "BuildingSpecifications" : window.location.href="BuildingSpecifications.html";
						break;
		
		case "TheArchitect" : window.location.href="TheArchitect.html";
						break;
		case "EsentepeNorth" : window.location.href="Esentepe.html";
						break;
		case "ContactUs" : window.location.href="ContactUs.html";
						break;
		case "HomePage" : document.location = "http://www.cyprus-seaterra.com";
						break;
		case "SitePhotos":	window.location.href="PicturesUser.php";
						break;
		case "login":	window.location.href="PersonalPrefEdit2.php";
						break;
		case "FAQ":		window.location.href="Faq.html";
						break;
		
		case "InspectionTrips":		window.location.href="http://www.cyprus-seaterra.com/InspectionTrip.php";
						break;
		case "AboutUs":		window.location.href="http://www.cyprus-seaterra.com/AboutUs.php";
						break;
		case "Testimonials" : window.location.href="http://www.cyprus-seaterra.com/testimonials.php";
						break;
		case "ShowFlat" : window.location.href="ShowFlatUser.php";
						break;
		
		case "SeaterraReserve" : document.location = "http://www.cyprus-seaterra.com/SeaterraReserve/";
						break;
																														
	}
	
}

function drawCallUs()
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='190' height='50' id='CALL US3' align='middle'>")
	document.write("<param name='allowScriptAccess' value='sameDomain' />")
	document.write("<param name='movie' value='../Call_Us.swf' />")
	document.write("<param name='quality' value='high' />")
	document.write("<param name='wmode' value='transparent' />")
	document.write("<param name='bgcolor' value='#ffcc33' />")
	document.write("<embed src='../Call_Us.swf' quality='high' wmode='transparent' bgcolor='#ffcc33' width='190' height='50' name='CALL US3' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />")
	document.write("</object>")

}

function drawFreeBut()
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ")
	document.write(" WIDTH='150' HEIGHT='32' id='But_Home1' ALIGN=''>")
	document.write("<PARAM NAME='movie' VALUE='../../InspectionTrips.swf'> <PARAM NAME='quality' VALUE='high'> <PARAM NAME='bgcolor' VALUE='#FFFFFF'> <EMBED src='but_free.swf' quality='high' bgcolor='#FFFFFF'  WIDTH='100' HEIGHT='32' NAME='but_free' ALIGN='' ")
	document.write(" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED> ")
	document.write(" </OBJECT>")
}

function InspectionTours()
{
//	var pic_top;
//	var pic_left;
//	var pic_width=575;
//	var pic_height=535;
//	var w = window.open("../../InspectionTrips.html","New","width="+pic_width+",height="+pic_height+",resizable=0,scrollbars=0,top="+pic_top+",left="+pic_left);
//	w.focus();
window.location.href="http://www.cyprus-seaterra.com/InspectionTrip.php";
}

function Title()
{
//	var pic_top;
//	var pic_left;
//	var pic_width=555;
//	var pic_height=450;
//	var w = window.open("../../Title.html","New","width="+pic_width+",height="+pic_height+",resizable=0,scrollbars=0,top="+pic_top+",left="+pic_left);
//	w.focus();
window.location.href="Title_esentepe.html";
}

function drawHeader(hl_image)
{
	document.write("<table BORDER='0' CELLPADDING='0' CELLSPACING='0' width='400'>");
	document.write("<tr><td align='left' valign='top'><IMG SRC='images/"+hl_image+"'></td>");
	document.write("	<!--<td align=right><script>drawCallUs()</script></td>-->");
	document.write("</tr></table>");
}

function MM_findObj(n, d) {var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_validateForm() {var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);if (val) { nm=val.name;pnm='pretty_'+nm;po=MM_findObj(pnm);if(po){ponm=po.value;}else{ponm=nm;}if ((val=val.value)!="") {if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');if (p<1 || p==(val.length-1)) {if (errors.indexOf('must contain an e-mail')==-1){errors+='- '+ponm+' must contain an e-mail address.\n';}}} else if (test!='R') { num = parseFloat(val);if (isNaN(val)) errors+='- '+ponm+' must contain a number.\n';if (test.indexOf('inRange') != -1) { p=test.indexOf(':');min=test.substring(8,p); max=test.substring(p+1);if (num<min || max<num) errors+='- '+ponm+' must contain a number between '+min+' and '+max+'.\n';} } } else if (test.charAt(0) == 'R') errors += '- '+ponm+' is required.\n'; }} if (errors){document.MyErrors +=errors;document.MM_returnValue=false;}}
function ShowErrors(){if (document.MyErrors!=''){alert('The following error(s) occurred:\n'+document.MyErrors);}}
function activate(field) {
  
  if(document.styleSheets)field.style.visibility  = 'visible';
  field.focus(); 
}
function last_choice(selection) {
  return (selection.value=="Other" || selection.value=="Magazine" || selection.value=="Exhibition"); 
}
function process_choice(selection,textfield,list) {
  if(last_choice(selection)) {
    textfield.value = '';
    if(document.styleSheets)list.style.visibility  = 'hidden';
    activate(textfield); 
	
	}
  else if(selection.value=="Newspaper"){
       
    if(document.styleSheets)textfield.style.visibility  = 'hidden';
    textfield.value = ''; 
	
	
	if(document.styleSheets)list.style.visibility  = 'visible';
    list.focus(); 
  }
  else {
       
    if(document.styleSheets)textfield.style.visibility  = 'hidden';
    textfield.value = ''; 
	if(document.styleSheets)list.style.visibility  = 'hidden';
	}
}
function moveSelectedNewspaperToOtherTextField()
{
	//the text field
	var oOther=document.getElementById("Other");
	// the list
	var oList = document.getElementById("NewspaperList");
													
	if(oList.style.visibility !='hidden')
	{
		oOther.value = oList.value;
	}
}

function LoadResize()
{
	calcIframeHeight('ifrBody');
}
function calcIframeHeight(iframeName)
{
	 //find the height of the internal page
		var the_height= document.getElementById(iframeName).contentWindow.document.body.scrollHeight;

		//change the height of the iframe
		document.getElementById(iframeName).height = the_height;
}

function tblRow(a,b,c,d)
{
	var popUp = " style='cursor:hand;' onmouseover='this.style.backgroundColor=\"#CA9383\"'  onmouseout='this.style.backgroundColor=\"\"'"
	
	if (b=="Garden")	popUp+="onclick='openWin(\"garden1_b.jpg\")'";
	if (b=="1st Floor") popUp+="onclick='openWin(\"Firstfloor2_b.jpg\")'";
	if (b=="Penthouse") popUp+="onclick='openWin(\"pentouse3_b.jpg\")'";
	
	document.write("<tr " + ((line==1)?"bgcolor=white":"bgcolor=#e6e6e6") + " align=center><td class=border_lb "+ popUp +" ><b>" + a + "</b></td><td class=border_lb>" + b + "</td><td class=border_lb>" + c + "</td><td class=border_lbr " + ((d!='Sold')?"style='font-weight:bold'":"") + ">" + d + "</td></tr>");
	line = -line;
}

function SetImageSrc(imgID,newImage)
{
	document.getElementById(imgID).src = newImage;
}

function openPopImg(pic_name,pic_width,pic_height) 
{

	var top, left

	top=10;
	left=100;
	if(pic_width==null){pic_width=250}
	if(pic_height==null){pic_height=200}
	window.open("big_pic1.html?NoReSize=0&pic_name="+pic_name,"New","width="+pic_width+",height="+pic_height+",resizable=0,scrollbars=0,top="+ top +",left="+ left );
}

function mailto(n) 
{
	n = n.replace(/\^/, '@');
	n = n.replace(/\~/, 'mailto:');
	n = n.replace(/\`/, '.');
	document.location.href=n;
}

//Testimonials - eli

function drawPageing(divid, pages)
{
	var path = document.location.search.substring(1).split('=')[1];
	if (path == null){path = 1;}
    var cp = path;
    var prev=path;
	var e = document.getElementById(divid);
	if (prev > 1){e.innerHTML = "<ul class='nav'>\n<a class='liLink' href='Testimonials.html?page=" + --prev + "'><li style='cursor:hand;' class='liItem'>&#60;&nbsp;Previous" + "</li></a>";}
	else{e.innerHTML = "<ul class='nav'>\n<li class='liItem'>&#60;&nbsp;Previous" + "</li>";}
	for (var i=1;i<=pages;i++) 
	{
        if (cp==i){e.innerHTML = e.innerHTML + "\n" + "<a  class='liSelectLink' href='Testimonials.html?page=" + i + "'>" + "<li style='cursor:hand;' class='liselected'>"  + i + " </li></a>";}
		else{e.innerHTML = e.innerHTML + "\n" + "<a  class='liLink' href='Testimonials.html?page=" + i + "'>" + "<li style='cursor:hand;' class='liItem'>"  + i + " </li></a>";}
	}
	if (path < pages){ e.innerHTML = e.innerHTML + "\n" + "<a class='liLink' href='Testimonials.html?page=" + ++path + "'>" + "<li style='cursor:hand;' class='liItem'>Next&nbsp;></li></a>";}
	else{e.innerHTML = e.innerHTML + "\n" + "<li class='liItem'>Next&nbsp;></li>";}
	e.innerHTML = e.innerHTML + "\n" + "<ul>";
}

function gotopage()
{
	var TitlesBank=  new Array ( "Villas in Cyprus", "Properties in Cyprus", "Cyprus properties", "Cyprus property", "Cyprus property" );
	var path = document.location.search.substring(1).split('=')[1];
    if (path == null) {path="1";}
	document.title = "Testimonials - " + TitlesBank[path-1] ;
	var e = document.getElementById("page" + path);
	e.style.display = "block";
	
}

//general

			function swap(Name, SwapImage)
			{
 
			  document.images[Name].src = SwapImage;
 
			}
		
