function openWin(pic_name,pic_width,pic_height) 
{

	if(pic_name=="freeTrip.gif")
	{
		InspectionTours();
	}else
	{
		var top, left
	
		top=10;
		left=100;
		if(pic_width==null){pic_width=250}
		if(pic_height==null){pic_height=200}
		window.open("big_pic.html?NoReSize=0&pic_name="+pic_name,"New","width="+pic_width+",height="+pic_height+",resizable=0,scrollbars=0,top="+ top +",left="+ left );
	}
}

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_pic.html?NoReSize=0&pic_name="+pic_name,"New","width="+pic_width+",height="+pic_height+",resizable=0,scrollbars=0,top="+ top +",left="+ left );
}

function openPopImg2(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.location.href = "big_pic2.html?NoReSize=0&pic_name=images/Large/"+pic_name ;
}
function openPopImg2NoLarge(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.location.href = "big_pic2.html?NoReSize=0&pic_name=images/"+pic_name ;
}

function drawMenu(item)
{
	document.write("<table BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
	if(item == "contact_us")
	{
		drawImage("buts/contact_us_d.jpg");
	}
	else
	{
		drawBut("contact_us","ContactUsSwf",154,28);
	}
	
	drawBut("reservehp","reservehpswf",154,28);
	document.write("<tr><td height='5px'></td></tr>");
	
	if(item == "seaterra_reserve")
	{
		drawImage("buts/seaterra_reserve_d.jpg");
	}
	else
	{
		drawBut("seaterra_reserve","SeaterraReserveSwf",154,28);
	}
	
	if(item == "location")
	{
		drawImage("buts/location_d.jpg");
	}
	else
	{
		drawBut("location","LocationSwf",154,28);
	}
	
	if(item == "site_plan")
	{
		drawImage("buts/site_plan_d.jpg");
	}
	else
	{
		drawBut("site_plan","SitePlanSwf",154,28);
	}
	
	if(item == "apartment_plans")
	{
		drawImage("buts/apartment_plans_d.jpg");
	}
	else
	{
		drawBut("apartment_plans","ApartmentPlansSwf",154,28);
	}
	
	if(item == "building_specification")
	{
		drawImage("buts/building_specification_d.jpg");
	}
	else
	{
		drawBut("building_specification","BuildingSpecificationSwf",154,28);
	}
	
	if(item == "pricelist")
	{
		drawImage("buts/pricelist_d.jpg");
	}
	else
	{
		drawBut("pricelist","PricelistSwf",154,28);
	}

	if(item == "showflat")
	{
		drawImage("buts/show-flat_d.jpg");
	}
	else
	{
		drawBut("showflat","showflatswf",154,28);
	}

	if(item == "virtual_tour")
	{
		drawImage("buts/virtual_tour_d.jpg");
	}
	else
	{
		drawBut("virtual_tour","VirtualTourSwf",154,28);
	}
	
	if(item == "site_photographs")
	{
		drawImage("buts/site_photographs_d.jpg");
	}
	else
	{
		drawBut("site_photographs","SitePhotographsSwf",154,28);
	}
	
	if(item == "faq")
	{
		drawImage("buts/faq_d.jpg");
	}
	else
	{
		drawBut("faq","FaqSwf",154,28);
	}
	
	if(item == "inspection_trip")
	{
		drawImage("buts/inspection trip_d.jpg");
	}
	else
	{
		drawBut("inspection_trip","InspectionTripSwf",154,28);
	}
	
	if(item == "testimonials")
	{
		drawImage("buts/testimonials_d.jpg");
	}
	else
	{
		drawBut("testimonials","TestimonialsSwf",154,28);
	}
	
	if(item == "investor_packages")
	{
		drawImage("buts/investor_packages_d.jpg");
	}
	else
	{
		drawBut("investor_packages","InvestorPackagesSwf",154,28);
	}
	
	if(item == "about_us")
	{
		drawImage("buts/about_us_d.jpg");
	}
	else
	{
		drawBut("about_us","AboutUsSwf",154,28);
	}
	
	if(item == "package")
	{
		drawImage("buts/package_d.jpg");
		
	}
	else
	{
		drawBut("package","PackageSwf",154,28);
	}
	drawImageLink("images/but_bay.jpg","../SeaterraBay/");
	//drawImageLink("images/reserve_villas.jpg","../SeaterraVillas/");
	drawImageLink("images/but_marina.jpg","../northerncyprus-properties/");
	drawImageLink("images/but_esentepe.jpg","../northcyprus-properties/");
	//drawIso("images/iso_reserve.gif");
	document.write("</table>\n");
}

function drawBut(butName,butID,width,height)
{
	document.write("<tr><td><OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
	document.write(" WIDTH='"+width+"' HEIGHT='"+height+"' id='"+butID+"' ALIGN=''>");
	document.write("<PARAM NAME='movie' VALUE='buts/"+butName+".swf'> <PARAM NAME='quality' VALUE='high'><PARAM NAME=wmode VALUE=transparent>  <PARAM NAME='bgcolor' VALUE='#E6EDDA'> <EMBED src='buts/"+butName+".swf' quality='high' bgcolor='#E6EDDA'  WIDTH='"+width+"' HEIGHT='"+height+"' NAME='"+butID+"' ALIGN='' ");
	document.write(" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED> ");
	document.write(" </OBJECT></td></tr>");
}

function drawImage(image)
{
	document.write("<tr>\n");
	document.write("	<td >\n");
	document.write("		<img src='"+ image +"' border='0'>\n");
	document.write("	</td>\n");
	document.write("</tr>\n");
}

function drawImageLink(image,sLink)
{
	document.write("<tr>\n");
	document.write("	<td align='center'>\n");
	document.write("		<a href='"+ sLink +"'><img src='"+ image +"' border='0'></a>\n");
	document.write("	</td>\n");
	document.write("</tr>\n");
}

function drawIso(image)
{
	document.write("<tr>\n");
	document.write("	<td align=\"center\" height='60px'>\n");
	document.write("		<img src='"+ image +"' border='0' >\n");
	document.write("	</td>\n");
	document.write("</tr>\n");
}

function SetLocation(item)
{
	switch (item)
	{
		case "SeaterraReserve" : document.location = "./";
						break;
		case "Location" : window.location.href = "Location.php";
						break;
		case "SitePlan" : window.location.href = "SitePlan.php";
						break;
		case "ApartmentPlans" : window.location.href = "ApartmentPlans.php";
						break;									
		case "SitePhotographs" : window.location.href = "SitePhotographs.php";
						break;
		case "BuildingSpecification" : window.location.href = "BuildingSpecification.php";
						break;
		case "Pricelist" : window.location.href = "PriceList.php";
						break;
		case "ContactUs" : window.location.href = "ContactUs.php";
						break;
		case "SeaterraProjects" : window.location.href = "http://www.cyprus-seaterra.com";
						break;
		case "BuildingSitePhotos" : document.location = "Images.php";
						break;
		case "Faq"		: window.location.href = "FAQ.php";
						break;
		case "InspectionTrip"		: window.location.href = "http://www.cyprus-seaterra.com/InspectionTrip.php";
						break;
		case "VirtualTour"	: window.location.href = "VirtualTour.php";
						break;
		case "Testimonials"	: window.location.href = "http://www.cyprus-seaterra.com/testimonials.php";
						break;	
		case "AboutUs"	: window.location.href = "http://www.cyprus-seaterra.com/AboutUs.php";
						break;
		case "ShowFlat" : window.location.href = "ShowFlatUser.php";
						break;
		case "InvestorPackages" : window.location.href = "http://www.cyprus-seaterra.com/InvestorPackages.php";
						break;
		case "PackageOptions" : window.location.href = "PersonalPrefEdit2.php";
						break;
		// Site Plans /////////////////////////////////////////
		case 'block_a' : window.location.href = "block_a.php";
			break;
		case 'block_a4_a5' : window.location.href = "block_a4_a5.php";
			break;
		case 'block_b' : window.location.href = "block_b.php";
			break;
		case 'block_c' : window.location.href = "block_c.php";
			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='../../Reserve/InspectionTrips.swf'> <PARAM NAME='quality' VALUE='high'> <PARAM NAME='bgcolor' VALUE='#FFFFFF'> <EMBED src='../../Reserve/js/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 drawLangButs()
{
	document.write("<a href='../../Reserve/SeaTerraBay-German'><img src='../../Reserve/js/images/german_normal.jpg' border='0' alt='Deutsch'></a>");
	document.write("<a href='../../Reserve/SeaTerraBay'><img src='../../Reserve/js/images/uk_invisible.jpg' border='0' alt='English'></a>");
}

function EnlargeBlock(block)
{
	window.location.href = "PicEnlarge.Html?PicPath=" + block;
}

function drawFooter()
{
	document.write('<BR>');
	document.write('<table class="sFooter"  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="../../Reserve/js/images/bullet.png">');
	document.write('			<span class="sFooter">SeaTerra Bay <a class="sFooter" href="../../Reserve/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="../../Reserve/northcyprus-properties">Northern Cyprus Properties in Esentepe</a> Area</span>');
	document.write('			<img src="../../Reserve/js/images/bullet.png">');	
	document.write('			<span class="sFooter"><a class="sFooter" href="../../Reserve/northerncyprus-properties">Northern Cyprus Properties in Tatlisu</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="../../Reserve/sitemap.html">North Cyprus Properties Site Map</a></span>');
	document.write('			<img src="../../Reserve/js/images/bullet.png">');
	document.write('			<span class="sFooter"><a class="sFooter" href="../../Reserve/js/location.html">North Cyprus Map</a></span>');
	document.write('			<img src="../../Reserve/js/images/bullet.png"> ');
	document.write('			<span class="sFooter"><a class="sFooter" href="../../Reserve/js/contact.html">Contact us</a></span>');
	document.write('		</td>');
	document.write('	</tr>');
	document.write('</table>');
}

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_reserve.php";
}


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='../../Reserve/js/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='../../Reserve/js/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 drawHeader(hl_image)
{
	document.write("<table BORDER='0' CELLPADDING='0' CELLSPACING='0' width='720'>");
	document.write("<tr><td rowspan=3 align='left' valign='bottom'><IMG SRC='../../Reserve/js/images/%22+hl_image+%22'></td>");
	document.write("	<td rowspan=3 align=right><script>drawCallUs()</script></td>");
	document.write("	<td align=right><script>drawLangButs()</script></td></tr>");
	document.write("<tr><td align=right><script>drawFreeBut()</script></td></tr></table>");
}

/*draws the little text in the buttom of pages: Pricelist for all units ..
  gets 1 parameter: boolean displayHeader which display or not the header*/
function drawArrangeTripAdd(displayHeader)
{
	document.write("<span class=\"txt\"><p>");
	if(displayHeader){
	document.write("<a href=\"http://www.cyprus-seaterra.com/SeaTerraBay/Price_List.php\">Pricelist for all units </a><br>");
	}
	document.write("<a href=\"http://www.cyprus-seaterra.com/testimonials.php\"><b>Read what others have to say </b></a>about purchasing their homes in SeaTerra Bay<br>");
	document.write("<strong>Want to arrange a trip?<br>");
	document.write("More information? <a href=\"http://www.cyprus-seaterra.com/SeaTerraBay/Contact.html\">Click here</a> </strong> or call <span style=\"color:#FF0000 \">toll free in the UK:<br>");
	document.write("0800-849-4168 or + 90-533-8613588 </span></p></span>");
}		
				
function onRow(row)
{
	row.style.background="#E5DE8E";
	row.cells(0).children(0).src = "images/faq/bullet2.gif";
}
			
function outRow(row)
{
	row.style.background="#D5E0C1";
	row.cells(0).children(0).src = "images/faq/bullet1.gif";
}				

				var vCurrTxtItem = "Sml1IMGTxt";
				function GetLPic()
				{
					return vLPic;
				}
				function SetLPic(sLPic)
				{
					vLPic = sLPic;
				}
				function SetImgTxt(sItem)
				{
					var oCurrItem = document.getElementById(vCurrTxtItem+"B");
					if(oCurrItem!=null){
						oCurrItem.style.display='none';
					}
					var oCurrItem = document.getElementById(vCurrTxtItem+"");
					if(oCurrItem!=null){
						oCurrItem.style.display='block';
					}
					var oItem = document.getElementById(sItem);
					if(oCurrItem!=null){
						oItem.style.display='none';
					}
					var oItem = document.getElementById(sItem+"B");
					if(oCurrItem!=null){
						oItem.style.display='block';
					}
					vCurrTxtItem=sItem;
				}

function SetMenu(ItemSrc)
			{
				//document.getElmentById("ifrBody").src = ItemSrc;
				window.ifrBody.src = ItemSrc;
				alert("test")
			}
			
function SetImageSrc(imgID,newImage)
{
	document.getElementById(imgID).src = newImage;
}

var vCurrImg=0;
			var vCurrImgTotal=0;
			var vCurrImgIsLast=0;
			var vCurrImgIsFirst=1;
			
			function NextImg()
			{
				//alert();
				ShowImg(1);
			}
			function PrevImg()
			{
				//alert();
				ShowImg(-1);
			}
			function ShowImg(vStep)
			{
				vCurrImg +=vStep;
				var oImgSrc = null;
				if(vCurrImgTotal==0)
				{
					oImgSrc = myGetElementById('imgSrcTotal');
					if(oImgSrc != null)
					{ 
						vCurrImgTotal = oImgSrc.value;
					}
				}
				oImgSrc = myGetElementById('ImgSrc'+vCurrImg);
				if(oImgSrc != null)
				{ 
					var vImgSrc = oImgSrc.value;
					//alert(document.getElementById('ImgShow').src);
					myGetElementById('ImgShow').src=vImgSrc;
					
					var oImgCount = myGetElementById('ImgCount');
					if(oImgCount != null)
					{
						oImgCount.value=vCurrImg+1;
					} 
					if(vCurrImg==(vCurrImgTotal-1))
					{
						SetForwardImg("../Images/but_forward_inert.jpg");
						vCurrImgIsLast=1;
					}
					else if(vCurrImg==0)
					{
						SetBackImg("../Images/but_back_inert.jpg");
						vCurrImgIsFirst=1;
					}
					else
					{
						
							vCurrImgIsLast=0;
							vCurrImgIsLast=0;
							SetForwardImg("../Images/but_foward_up.jpg");
							vCurrImgIsFirst=0;

							SetBackImg("../Images/but_back_up.jpg");
							
						
					}
				}
				else
				{
					vCurrImg -=vStep;
				}
			}
			function OpenCurrImg()
			{
				var oImgSrc = myGetElementById('ImgLSrc'+vCurrImg);
						
				if(oImgSrc != null)
				{ 
					var vImgSrc = oImgSrc.value;
					var vImgPath = vImgSrc;
					
					openPopImg(vImgPath,640,480);
				}
			}
			function SetForwardImg(sImgSrc)
			{
				var oImgSrc = myGetElementById('imgForward');
				if(oImgSrc != null)
				{ 
					if(vCurrImgIsLast==0){
						oImgSrc.src=sImgSrc;
					}
				}
			}
			function SetBackImg(sImgSrc)
			{
				var oImgSrc = myGetElementById('imgBack');
				if(oImgSrc != null)
				{ 
					if(vCurrImgIsFirst==0){
						oImgSrc.src=sImgSrc;
					}
				}
			}
			function myGetElementById(id)
			{
				if (document.getElementById)
				{
					return document.getElementById(id);
				}
				else
				{
					return document.all[id];
				}
			}
			
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.php?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.php?page=" + i + "'>" + "<li style='cursor:hand;' class='liselected'>"  + i + " </li></a>";}
		else{e.innerHTML = e.innerHTML + "\n" + "<a  class='liLink' href='Testimonials.php?page=" + i + "'>" + "<li style='cursor:hand;' class='liItem'>"  + i + " </li></a>";}
	}
	if (path < pages){ e.innerHTML = e.innerHTML + "\n" + "<a class='liLink' href='Testimonials.php?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;
 
}
	

