// Javascript routines for www.rural-france.com
// Copyright M.J.C. Griffin
// Version 2.7 17Nov10

function openWindow(add,name){window.open(add,name,'width=820,height=590,scrollbars=yes,toolbar=yes,status=no,resizable=yes, left=100,top=50,screenX=100,screenY=50');}

function openVarWin(add,name,w,h){window.open(add,name,'width='+w+',height='+h+',directories=no,location=no,menubar=no,titlebar=no,scrollbars=no,toolbar=no,status=no,resizable=no, left=100,top=50,screenX=100,screenY=50');}

function openScrollWin(add,name,w,h){window.open(add,name,'width='+w+',height='+h+',scrollbars=yes,toolbar=no,status=no,resizable=yes, left=80,top=0,screenX=80,screenY=0');}

function openFullWin(add,name,w,h){window.open(add,name,'width='+w+',height='+h+',scrollbars=yes,toolbar=yes,status=yes,resizable=yes, left=50,top=0,screenX=50,screenY=0');}

var addr1="gite";
var addr2="rural-france";

function male(){
document.write("<a href=mailto:"+addr1+"@"+addr2+".com"+">");
   }

function malePlus(){
male();
document.write(addr1+"@"+addr2+".com");
   }

HiRate="&pound;495";
MidRate="&pound;395";
LoRate="&pound;250";
MidHiRate="&pound;450";
MidMidRate="&pound;325";

SterlingDollarRate=1.60

HiRateUS="$800";
MidRateUS="$640";
LoRateUS="$375";
MidHiRateUS="$675";
MidMidRateUS="$485";

SterlingEuroRate=1.15

HiRateEuro="610&euro;";
MidRateEuro="490&euro;";
LoRateEuro="300&euro;";
MidHiRateEuro="520&euro;";
MidMidRateEuro="380&euro;";

function doPriceTable(){
   doPriceTableheader();
   doPrices(HiRate,MidRate);
   doPrices(HiRateUS,MidRateUS);
   doPrices(HiRateEuro,MidRateEuro);
   closePriceTable();
}

function doPriceTableheader(){
   document.write("<table align='center' border='1' cellpadding='2' bgcolor='#C0C0C0' bordercolor='#FFFF00'><tr><td align='center' id='hdg'>Jul/Aug</td><td align='center' id='hdg'>Jun/Sep</td></tr>");
}

function doPrices(Hi,Mid){
   document.write("<tr><td align='center' width='100' id='blueonsilver' bordercolor='#FFFF00'>"+Hi+" per week</td><td align='center' width='100' id='blueonsilver' >"+Mid+" per week</td>");
}

function closePriceTable(){
   document.write("</table>");
}

function doSectionHdg(Text) {
   document.write("<table><tr><td><img src='./Images/RedBall.gif'><td valign='top' id='SectionHdg'>&nbsp;"+Text+"</table>");
}

function PopUpVideo(x,sub) {
document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
document.write("<a href=\"javascript:openVarWin('VideoWin.php?Video="+x+"','vid','370','320')\">");
document.write("<img src='Icons/ViewVideo.gif' border='0'"); 
document.write("alt='Click to play a video of "+sub+" in a new window, but only if you have HIGH-SPEED Internet access'");
document.write("title='Click to play a video of "+sub+" in a new window, but only if you have HIGH-SPEED Internet access'></a>");
}	

//Specify optional button target: "_new" for new window, or name of FRAME target (ie "myframe")
var buttontarget=""

if (document.images){
after=new Image()
//Enter image path of second image (for preloading purposes):
after.src="./Images/Buttons/SearchButton_roll.png"
}

function change2(e, image){
var el=window.event? event.srcElement: e.target
if (el.tagName=="INPUT"&&el.type=="submit")
el.style.backgroundImage="url"+"('"+image+"')"
}

function jumpto2(url){ // This function allows you to specify a different exit address - use with 'OnClick'
if (buttontarget=="")
window.location=url
else if (buttontarget=="_new")
window.open(url)
else
parent[buttontarget].location=url
}

var preload=new Image(); // ensure rollover button is preloaded
preload.src="./Images/Buttons/button_roll.png";

