var REFER = "HOME";
//window.onresize=setGWidth; 
if  (document.referrer != "") { REFER = document.referrer; }
function vetreferrer()
{
var xresult = "";
var ptstr = new String(REFER);

if (ptstr.indexOf("?") == -1) { return; }
if (ptstr.indexOf("&") == -1) { return; }
if (ptstr.indexOf("=") == -1) { return; }
var plist = ptstr.split("?");
xresult = unescape(plist[0]);
xresult += "=";
var alist = plist[1].split("&");
var i;
for (i = 0; i < alist.length; i++) {
	     var elist = alist[i].split("=");
         if (elist[0] == "q" || elist[0] == "title" || elist[0] == "keyword" || elist[0] == "searchfor" || elist[0] == "search") {
                                 xresult += unescape(elist[1]);
                                 break;
         }
}
REFER = xresult;
}
function checkStatus()
{
var olduser = geteCookie('EUSER');
if (!olduser) 
     { vetreferrer(); 
       seteCookie('EUSER', REFER, null, '/');
	   }
var oldstage = geteCookie('Stage'); 
//document.FORMQ.STAGE.value = oldstage;
if (oldstage != "2") { seteCookie('Stage', '0', null, '/');
                       seteCookie('UniqueRef', 'Z', null, '/');
                      }
}





function setpage()
{
var htracker =  geteCookie("htracker");
var country = geteCookie("country");
if ( country != 3) {
        country = 3;
		seteCookie( 'country', '3');
		}
if (htracker != "ho") {
			seteCookie( 'htracker', 'ho');
					    }
seteCookie( 'tracker', 'ib'); 
document.FORMQ.F2H.value = '3';
}

function SubmitForm()
{
if (!validates()) { return; }
document.FORMQ.submit();
}

function validates()
{
var xxx = document.FORMQ;
with (xxx) {
 if (buttonpress.value == "N"){ return false; }  
 if (F2A.value == '0') {
        alert("Please set the geographical area you require") 
        return false;
        }
if (F2A.value > '2' && F2D.value == '13') {
        alert("Area 2 only for 13 months duration") 
        return false;
        }	
if (F2A.value <'2' && F2D.value == '13') {
        alert("Area 2 only for 13 months duration") 
        return false;
        }		
  seteCookie('process', '2', null, '/');     
       
 }
return true;
}
function buttonpressed()
{
document.FORMQ.buttonpress.value = "Y";
}	
//function getsearch()
//{
//var aterm = document.FORMQ.F6SEARCH.value;
//seteCookie( 'F6SEARCH', aterm);
//window.location.href="etlookin.asp";
//}
function setSidebar(s)
{
 if (s == "0") { moveIt('easysteps','sidebar' ) }
 if (s == "1") { moveIt('europe','sidebar' ) }
 if (s == "2"){ moveIt('stopover','sidebar' ) }
 if (s == "3") { moveIt('wintersports','sidebar' ) } 
 if (s == "4") { moveIt('skydiving','sidebar' ) } 
}
