function g(x){ return document.getElementById(x); }
function jsTest(x){
	try{eval(document.getElementById(x).value);}catch(e){
	var v1=''; var v2=''; var v3=''; var str=''; var descr=false;
	for(j in e){
		if(j=='stack' || j=='number')continue;
		if((j=='message' || j=='description') && descr)continue
		if(j=='description' || j=='message')descr=true;
		str+=(j+': '+e[j])+"\n";
	}
	alert(str);
	}return false;
}

//-------------------------- No rightclick script -------------------------
// Put your message for the alert box between the quotes.
var message="Are You Looking For Great Fun?  Fox River Bed and Breakfast in Ottawa, Illinois will arrange the best canoe trips for you even if you decide to stay somewhere else!";
// Find more great scripts and applets at the JavaFile!
// http://www.javafile.com
// Do not delete this header!
// Don't edit below!

function click(e){
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//End of  no right click script




//PopUnder Power
//Credit notice must stay intact for use.
// Visit http://www.mikenew.net/downloads/scripts.asp for more scripts.
// by Mike New, with special thanks to
// Jeff Phillips of http://classadrivers.com, for some good mods
// If you use this script, or make it better, I'd love to see it in action! webmaster@mikenew.net



// Begin. Specify URLs to randomly select from and pop-under. Add or take away freely.
var popunder=new Array();
var loc=location+'';
if(loc.indexOf('?')!==-1){
	var l=loc.split('?');
	loc=l[1];
}else{
	loc='';
}
popunder[0]="http://sys.relatebase.com/cl/frbnb/cgi/add_modify.php?winLvl=1&ReferralHTTP="+escape(document.referrer)+"&ReferralTerm="+escape(loc)+"&ReferralCode=3DAYFREE_01&customMessage[insertBodyTop]=true&src=add_result_close.php";

// Specify the width and height of new popunder window (in pixels).
var width = '600';
var height = '650';
var p = 'scrollbars=yes,resizable=yes,toolbar=no,menubar=yes,status=yes,location=no,left=85,top=20,height=' + height + ',width=' + width;

// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1


// That's it! Don't edit the code below unless you're really good. :-P //
function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
	offset = document.cookie.indexOf(search)
	if (offset != -1) { // if the cookie exists
	offset += search.length
	end = document.cookie.indexOf(";", offset); // set the index of beginning value
	if (end == -1) // set the index of the end of cookie value
	end = document.cookie.length;
	returnvalue=unescape(document.cookie.substring(offset, end))
	}
	}
	return returnvalue;
}
function loadornot(){
	if (get_cookie('popunder')==''){
	load_pop_power()
	document.cookie="popunder=yes"
	}
}
function load_pop_power(){
	try{
		win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"bw",p)
		win2.blur()
		window.focus()
	}catch(e){  }
}
if (one_time==0){
	load_pop_power();
}else{
	loadornot();
}


function gCookie(ck){
	var cVal = document.cookie;
	var cStart = cVal.indexOf(" " + ck + "=");
	if(cStart==-1)	cStart = cVal.indexOf(ck + "=");
	if(cStart == -1){
		cVal = null;
	}else{
		cStart = cVal.indexOf("=", cStart) + 1;
		var cEnd = cVal.indexOf(';', cStart);
		if(cEnd==-1) cEnd=cVal.length;
		cVal = unescape(cVal.substring(cStart,cEnd));
	}
	return cVal;
}
function sCookie(cName,cVal,cExp,cPath){
	cVal = escape(cVal);
	if(typeof cExp == 'undefined'){
		var nw = new Date();
		nw.setMonth(nw.getMonth() + 6);
		var expiry= ";expires="+nw.toGMTString();
	}else if(cExp==0){
		var expiry='';
	}else{
		var expiry=';expires='+cExp;
	}
	if(typeof cPath == 'undefined'){
		var path=';Path=/';
	}else{
		var path = ";Path="+cPath;
	}
	//if(testmode==1) alert(cName + "="+cVal + expiry+path);
	document.cookie = cName + "="+cVal + expiry+path;
}

function addTerm(fieldID){
	/** v1.00 - this function adds the term code to a paypal field prior to submitting **/
	if(!gCookie('term'))return;
	if(gCookie('termIncl')=='1')return; //has been added to one of the items
	var e='';
	if(!(e=document.getElementById(fieldID))) return;
	if(e.value.indexOf('(')!==-1)return; //already done for this item_name
	e.value+=' (C:' + gCookie('term')+')';
	//set a cookie for this session indicating that the term has been set on ONE paypal item (so it doesn't appear next to each description)
	sCookie('termIncl','1',0);
}

