
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

/*	This Creates a Text Link for Bookmark This Page
	text is what text you want to display like "Bookmark Us!"
*/
function createbookmarklink(txt){

	// do not edit below this line
	// ===========================
	
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
	   document.write('<A HREF="javascript:window.external.AddFavorite(' + document.URL + ',' + document.title + ');" ');
	   document.write('onMouseOver=" window.status=');
	   document.write("txt; return true ");
	   document.write('"onMouseOut=" window.status=');
	   document.write("' '; return true ");
	   document.write('">'+ txt + '</a>');
	}else{
	   txt += "  (Ctrl+D)";
	   document.write(txt);
	} 
}

/*	This is a link that you can link anything to (like a button)
	it bookmarks the page for IE, and for other browsers
	it displays an alert box telling them to press CTRL + D
	to bookmark the page.
*/
function bookmark(){
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
		window.external.AddFavorite(' + document.URL + ',' + document.title + ');
	}else{
		alert("Press CTRL + D to bookmark this page.");
	} 
}

function sendtofriend(){
	
	url = document.URL;
	sendtofriend_page = "sendtofriend.php";
	
	// each slash is another level down
	number_of_slashes = url.split("/").length-1;
	// omit the first slash because that means it's in the root directory (not a level down)
	number_of_slashes--;
	
	for(i=0; i < number_of_slashes; i++){
		sendtofriend_page = "../" + sendtofriend_page;
	}
	
	window.open(sendtofriend_page + "?page=" + url, "sendtofriend", "width=400, height=300");
}

// wrapper, so that the popup works in firefox
function windowopen(s_url, s_window, s_features){
	window.open(s_url, s_window, s_features);	
}


function playeropen(url){
	filetype = url.substr(url.length-3, 3).toLowerCase();
	if(filetype == "wmv")
		window.open("player.php?file=" + url + "&movieheight=287", "player", "width=350, height=351, resizable=yes");
	else if(filetype == "wma")
		window.open("player.php?file=" + url + "&movieheight=73", "player", "width=350, height=137, resizable=yes");
	else
		alert("Unsupported file type. Please notify the webmaster at info@hotrideshow.com.");
}

function imagecloseup(url, caption){
	window.open("imagecloseup.php?image=" + url + "&caption=" + caption, "imagecloseup", "width=550, height=400, resizable=yes");
}