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 drawMenu()
{

drawBut("But_ContactUs",175,32);
	//drawBut("But_seaterraProjects",175,32);
	drawBut("But_marinahp",175,32);
	drawBut("But_Marina2",175,32); 
	drawBut("But_location3",175,32);
	drawBut("But_Inspec_Trips",175,32);
	drawBut("But_Testimonials",175,32);
	drawBut("But_aboutus",175,32); 
	
	//drawBut("But_siteplan4",175,32);
	//drawBut("But_Apartment5",175,32); 
	//drawBut("But_Building6",175,32);
	//drawBut("But_Pricelist7",175,32); 
	//drawBut("But_ Architect8",175,32);
	//drawBut("But_SitePhotos",175,32);
	//drawBut("But_FAQ",175,32);
    //drawBut("But_CompletionUpdates",175,32);
	//drawBut("package_marina",175,32);
	//drawBut("But_Forum_Marina",198,32);
	//drawBut("But_Investor",175,32);
	
	
	//drawImageLink("images/but_reserve.jpg","../SeaterraReserve");
	drawImageLink("images/but_bay.jpg","../SeaterraBay");
	//drawImageLink("images/marina_villas.jpg","../SeaterraVillas/");
	drawImageLink("images/but_esentepe.jpg","../northcyprus-properties");
	//drawIso("images/iso_marina.gif");
}

function drawBut(butName,width,height)
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ")
	document.write(" WIDTH='"+width+"' HEIGHT='"+height+"' id='But_Home1' ALIGN=''>")
	document.write("<PARAM NAME='movie' VALUE='buts/" + butName + ".swf'> <PARAM NAME='quality' VALUE='high'> <PARAM NAME='bgcolor' VALUE='#EEEEEE'> <EMBED src='buts/" + butName + ".swf' quality='high' bgcolor='#EEEEEE'  WIDTH='"+width+"' HEIGHT='"+height+"' 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 "SeaTerraMarina" : document.location = "index.html";
						break;
		case "Location" : document.location = "location.html";
						break;
		case "SitePlan" : document.location = "site_plan.html";
						break;
		case "ApartmentPlans" : document.location = "ap_plan.html";
						break;									
		case "TheArchitect" : document.location = "arch.html";
						break;
		case "BuildingSpecification" : document.location = "build_spec.html";
						break;
		case "ContactUs" : document.location = "contact.html";
						break;
		case "HomePage" : document.location = "http://www.cyprus-seaterra.com";
						break;
		case "BuildingSitePhotos" : document.location = "PicturesUser.php";
						break;
		case "Faq"		: document.location = "FAQ.html";
						break;
		case "InspectionTrips" : document.location = "http://www.cyprus-seaterra.com/InspectionTrip.php";
						break;
		case "Testimonials" : document.location = "http://www.cyprus-seaterra.com/testimonials.php";
						break;
		case "AboutUs" : document.location = "http://www.cyprus-seaterra.com/AboutUs.php";
						break;
		case "ShowFlat" : document.location = "ShowFlatUser.php";
						break;
		
		case "InvestorPackages" : document.location = "http://www.cyprus-seaterra.com/InvestorPackages.php";
						break;
		case "personalprefedit" : document.location = "PersonalPrefEdit2.php";
						break;
		case "SeaterraReserve" : document.location = "http://www.cyprus-seaterra.com/SeaterraReserve/";
						break;
		case "Completion updates" : document.location = "CompletionUpdates.html";
						break;				
						
																														
	}
}

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 drawFooter()
{
	document.write('<table class="txt"  style="width: 650">');
	document.write('	<tr>');
	document.write('		<td align="center">');
	document.write('		<span style="height: 3px; width: 95%; border-top: 3px solid #F78326;"></span></td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td align="center">');
	document.write('			<span class="sFooter"><a class="sFooter" href="http://www.cyprus-seaterra.com">Northern Cyprus Property</a> Home Page</span>');
	document.write('			<img src="images/bullet.png">');
	document.write('			<span class="sFooter">SeaTerra Bay <a class="sFooter" href="../SeaTerraBay/">Northern Cyprus Property Development</a></span>');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td align="center">');
	document.write('			<span class="sFooter"><a class="sFooter" href="../northcyprus-properties/">Northern Cyprus Properties in Esentepe</a> Area</span>');
	document.write('			<img src="images/bullet.png">');	
	document.write('			<span class="sFooter"><a class="sFooter" href="./">Northern Cyprus Properties in Kyrenia</a> Area</span>');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('	<tr>');
	document.write('		<td align="center">');
	document.write('			<span class="sFooter"><a class="sFooter" href="../sitemap.html">North Cyprus Properties Site Map</a></span>');
	document.write('			<img src="images/bullet.png">');
	document.write('			<span class="sFooter"><a class="sFooter" href="location.html">North Cyprus Map</a></span>');
	document.write('			<img src="images/bullet.png"> ');
	document.write('			<span class="sFooter"><a class="sFooter" href="contact.html">Contact us</a></span>');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('</table>');
}

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 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();
document.location = "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();
document.location = "Title_Marina.html";
}

function drawHeader(hl_caption)
{
	document.write("<TABLE WIDTH='81%' BORDER='0' CELLSPACING='0' CELLPADDING='0'")
	document.write("<TR>")
	document.write("<TD><img src='images/pixel.gif' width='5'></TD>")
	document.write("<TD><h1 class='TopCaption'>"+hl_caption+"</h1>")
	document.write("</TD>")
	document.write("<TD align='right' valign='top'>")
	document.write("<script>drawCallUs()</script>")
	document.write("</TD>")
	document.write("<TD align='right' valign='top'>")
	document.write("<script>drawFreeBut()</script>")
	document.write("</TD>")
	document.write("</TR>")
	document.write("</TABLE>")

/*	document.write("<table BORDER='0' CELLPADDING='0' CELLSPACING='0' width='720'>");
	document.write("<tr><td align='left' valign='bottom'><IMG SRC='../Images/"+hl_image+"'></td>");
	document.write("	<td align=right><script>drawCallUs()</script></td>");
	document.write("<td align=right><script>drawFreeBut()</script></td></tr></table>");*/
}

function getURLParam(strParamName)
{
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 )
  {
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    //alert(strQueryString)
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
    {
      if (aQueryString[iParam].indexOf(strParamName + "=") > -1 )
      {
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
} 


function rSize()
{
	window.resizeTo(parseInt(document.myImage.width+36),parseInt(document.myImage.height+60))
	
	var top  = parseInt(screen.height - parseInt(document.getElementById("myImage").height) )/2; 
	var left = parseInt(screen.width - parseInt(document.getElementById("myImage").width) )/2; 
	
	window.moveTo(left,10)
}

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;
	}
}

/// For Completion Updates 
function onRowC(row)
	{
		row.style.background="#FFFFFF";
		row.cells(0).children(0).src = "Images/CompletionUpdates/bullet_w.gif";
	}
	
	function outRowC(row)
	{
		row.style.background="#C1CEEF";
		row.cells(0).children(0).src = "Images/CompletionUpdates/bullet_1.gif";
	}
	
// For FAQ	

function onRow(row)
	{
		row.style.background="#FFFFFF";
		row.cells(0).children(0).src = "Images/W_marinaBullet.gif";
	}
	
	function outRow(row)
	{
		row.style.background="#C1CEEF";
		row.cells(0).children(0).src = "Images/B_MarinaBullet.gif";
	}
	
	
function tblRow(a,b,c,d,headerTR)
{
	if( d.toLowerCase() != "sold")
	{
		document.getElementById(headerTR).style.display = "";
		var popUp = " style='cursor:hand;' onmouseover='this.style.backgroundColor=\"#CA9383\"'  onmouseout='this.style.backgroundColor=\"\"'"
		
		if (b=="Garden")	popUp+="onclick=\"document.URL='big_pic.html?pic_name=garden1_b.jpg';\"";
		if (b=="1st Floor") popUp+="onclick=\"document.URL='big_pic.html?pic_name=Firstfloor2_b.jpg';\"";
		if (b=="Penthouse") popUp+="onclick=\"document.URL='big_pic.html?pic_name=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 mailto(n) 
{
	n = n.replace(/\^/, '@');
	n = n.replace(/\~/, 'mailto:');
	n = n.replace(/\`/, '.');
	document.location.href=n;
}

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 );
}


//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;
 
	}
