// JavaScript Document

function bookmarksite(title, url)
{
	if (document.all)	window.external.AddFavorite(url, title);
	else if (window.sidebar) window.sidebar.addPanel(title, url, "")
}

function playVideo(vPath)
{
	var nc="&nc="+Math.random();
	var vURL=vPath;
	var color1 = "006699";
	var color2 = "54abd6";
	/*
	 <cfset color1["purple"] = "593f9c">
	 <cfset color2["purple"] = "a88eeb">
	 
	 */
	if(color.toLowerCase() == "purple"){color2 = "a88eeb"; color1 = "593f9c";}
	else if(color.toLowerCase() == "darkcyan"){color2 = "5DBDBD"; color1 = "017474";}
	else if(color.toLowerCase() == "firebrick"){color2 = "e38383"; color1 = "cc1c1c";}
	else if(color.toLowerCase() == "goldenrod"){color2 = "D49F1A"; color1 = "705101";}
	else if(color.toLowerCase() == "maroon"){color2 = "B4969B"; color1 = "65474C";}
	else if(color.toLowerCase() == "limegreen"){color2 = "97B353"; color1 = "486501";}
	else if(color.toLowerCase() == "pink"){color2 = "DF74DF"; color1 = "902590";}
	else if(color.toLowerCase() == "silver"){color2 = "A0A0A0"; color1 = "515151";}
	else if(color.toLowerCase() == "tan"){color2 = "AD9E8A"; color1 = "5E4F3B";}
	
	
	if(vPath.indexOf(".avi")>0 || vPath.indexOf(".mpeg")>0 || vPath.indexOf(".wmv")>0 || vPath.indexOf(".mpg")>0 || vPath.indexOf(".mov")>0)
	{
		//other unsupport movies
		var embstr = "<object NAME=\"Player\" width=332 height=280  align=\"left\"  type=\"application/x-mplayer2\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\">";
		embstr += "<param NAME=\"URL\" VALUE='"+vPath+"'><param>";
		embstr += "<param NAME=\"AUTOSTART\" VALUE=\"false\"></param>";
		embstr += "<param NAME=\"wmode\" VALUE=\"opaque\"></param>";
		embstr += "<param name=\"showControls\" value=\"true\"></param>";
		embstr += "<embed width=425 height=264  align=\"left\" SRC='"+vPath+"' type=\"application/x-mplayer2\" AUTOSTART=\"false\" wmode=\"opaque\"></embed></object>";
	}
	
	else if(vPath.indexOf("youtube")>-1)
	{
		//youtube
		var vURL=vPath+"&hl=en&rel=0&color1=0x"+color1+"&color2=0x"+color2+"&autoplay=0";
		var embstr="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=425 height=264   id=\"hartv_video\" align=\"middle\"><param name=\"movie\" value='"+vURL+"' /><param NAME=\"wmode\" VALUE=\"opaque\"></param><param name=\"quality\" value=\"high\" /><embed src='"+vURL+"' quality=\"high\" bgcolor=\"#ffffff\" width=425 height=264 name=video align=middle  wmode=\"opaque\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	}
	else if(vPath.indexOf("rtmp")>-1)
	{
		var embstr="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=425 height=264   id=\"hartv_video\" align=\"middle\"><param name=\"movie\" value=\"http://www.har.com/hartv/harplayer.swf?serverURL=http://www.har.com/hartv/&p="+vPath+"&vid="+vID+nc+"\" /><param NAME=\"wmode\" VALUE=\"opaque\"></param><param name=\"allowFullScreen\"  value=\"True\"><param name=\"quality\" value=\"high\" /><embed src=\"http://www.har.com/hartv/harplayer.swf?serverURL=http://www.har.com/hartv/&p="+vPath+"&vid="+vID+nc+"\" quality=\"high\" bgcolor=\"#ffffff\" width=425 height=264 name=video align=middle  wmode=\"opaque\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	}
	
	else if(vPath.indexOf("megavideo")>-1 || vPath.indexOf("metacafe")>-1 || vPath.indexOf("google")>-1 || vPath.indexOf(".swf")>-1 || vPath.indexOf("brightcove")>-1)
	{
		var vURL=vPath;
		var embstr="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=425 height=264   id=\"hartv_video\" align=\"middle\"><param NAME=\"wmode\" VALUE=\"opaque\"></param><param name=\"movie\" value='"+vURL+"' /><param name=\"quality\" value=\"high\" /><embed src='"+vURL+"' quality=\"high\" bgcolor=\"#ffffff\" wmode=\"opaque\" width=425 height=264 name=video align=middle  type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	}
	else
	{
		var embstr="<div style='margin:20px;font-size:20px;color:#fff;font-weight:bold;'>Loading External Video</div>";
		window.open(vPath,"extPlayer").focus();

		return;
	}
	document.getElementById("myVidPlayer").innerHTML="<div style='padding:0px 5px 10px 0px;'>" + embstr +"</div>";
}

function get(str)
{
	return document.getElementById(str);
}

function toggle(div)
{
	var obj = get(div);
	if(obj.style.display == "none") obj.style.display = "block";
	else obj.style.display = "none";
	
	return false;
}
	
function popunder()
{
	//get('ifContact').onload = testing;
	get('ifContact').src = url;
	getSize();
	get('dimmer').style.display = "block";
	get('dimmer').style.visibility = "visible";
	get('contactme').style.top = (Math.floor(viewportheight / 2) - Math.floor(get('contactme').offsetHeight / 2)) + "px";
	get('contactme').style.left = Math.floor(viewportwidth / 2) - Math.floor(get('contactme').offsetWidth / 2) + "px";
	get('contactme').style.visibility = "visible";
}

function popclose()
{
	get('contactme').style.visibility = "hidden";
	get('dimmer').style.visibility = "hidden";
	get('dimmer').style.display = "none";
}
	
function testing()
{
	//alert(get('ifContact').contentDocument.body);
}

var viewportwidth;
var viewportheight;

function getSize()
{

	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	
	if (typeof window.innerWidth != 'undefined')
	{
		viewportwidth = window.innerWidth,
		viewportheight = window.innerHeight
	}
	
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	
	else if (typeof document.documentElement != 'undefined'
	&& typeof document.documentElement.clientWidth !=
	'undefined' && document.documentElement.clientWidth != 0)
	{
		viewportwidth = document.documentElement.clientWidth,
		viewportheight = document.documentElement.clientHeight
	}
	
	// older versions of IE
	
	else
	{
	viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
	viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}
}
//window.close = popclose;
var iframe;