/*
###### NOTICE ######
# This script was written by terabit.ca. All rights reserved.
# You are not authorized to sell/trade or give away this script
# without the prior written consent of terabit.ca.  
#
# To contact the developers of this script please visit 
# http://www.terabit.ca or send an email to sales@terabit.ca.
###### NOTICE ######
*/

function popup(pageURL,x,y)
{

 var newwin = window.open( pageURL, "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + x + ",height=" + y + ",resizable=yes" );

}

function LaunchTuneIn(){
  popup('tunein.php',380,380);
}

function is_numeric(val){
	var reg = new RegExp("^[0-9]*.[0-9]*$", "i");
	var m = reg.exec(val);
	if (m == null) {
		return false;
	}
	return true;
}	



// google ad control
function showAds(minWidth, adWidth){
	// get window width
	var winWidth = (is_numeric(document.body.clientWidth))?document.body.clientWidth:document.documentElement.clientWidth;
	//var winWidth = screen.availWidth; // this gets the screen resolution
	var adRight = document.getElementById('adRight');
	var adLeft = document.getElementById('adLeft');
	
	if(winWidth > minWidth + adWidth + adWidth){
		if(adRight) adRight.style.display = 'block';
		//if(adLeft) adLeft.style.display = 'block';
	}
	else if(winWidth > minWidth + adWidth){
		if(adRight) adRight.style.display = 'block';
		if(adLeft) adLeft.style.display = 'none';
	}
	else{
		if(adRight) adRight.style.display = 'none';
		if(adLeft) adLeft.style.display = 'none';
	}
	//document.title = winWidth;
}
