//-----------------------------------//
//--- "WRITE NAVIGATION" FUNCTION ---//
//-----------------------------------//

function writeNav(link,name,title) {
		document.write('<tr><td class="navstyle" align="center"><a title="'+title+'" href="'+link+'" onClick="clickTrack(this.href,this.title);">'+name+'</a></td></tr>');
}



//-----------------------------------//
//---- BREAK OUT OF FRAMES TOOL -----//
//-----------------------------------//

if (top.location != this.location) {
    top.location.href = document.location.href;
}


//-----------------------------------//
//---- VIDEO PLAYER POP CONTROL -----//
//-----------------------------------//

function vidPlayer(idnum) {

	window.open('/pages/videoplayer/video.php?vid='+idnum,'vidBox','width=600,height=430,scroll=no,status=no');

}

//-----------------------------------//
//--- TERMS OF SERVICE FUNCTIONS ----//
//-----------------------------------//


$("#newsdubs").submit(function() {
	if($("tosaccept").attr('checked')) {
		return true;
	} else {
		alert("You must accept the Terms of Service.");
		return false;
	}
});



//-----------------------------------//
//---- ClickTrack - (c) WMGM-TV -----//
//-----------------------------------//


function clickTrack(url,name) {
 	var xmlHttp = null;
  	try {
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if(xmlHttp == null) {
		return;
	}
	xmlHttp.onreadystatechange=function() {
      		if(xmlHttp.readyState==4) {
			return true;
			// =xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET","clickTrack.php?url="+url+"&name="+name,true);
	xmlHttp.send(null);
}



//-----------------------------------//
//---- NEWS DUBS: CLIENT/VIEWER -----//
//-----------------------------------//


function doCheck() {
	if(document.newsdubs.ima.options[document.newsdubs.ima.selectedIndex].value == "Client")
	{
		$("#cblock").show();
		$("#companyblock").slideDown("normal");
		$("#companyblock2").slideDown("normal");
	}
	else
	{
		$("#companyblock").slideUp("normal");
		$("#companyblock2").slideUp("normal");
	}
}