//<!--

//opens a horizontal rectangle pop up
function infoWindow(url){
	var w=300;
	var h=50;
	var leftPos=(screen.width)?(screen.width-w)/2:100;
	var topPos=(screen.height)?(screen.height-h)/2:100;
	var	settings='width='+w+',height='+h+',top='+topPos+',left='+leftPos+',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';
	var ccWindow=window.open(url,'Information',settings);
	ccWindow.focus();
}

//default ClickCalling new window script
function ClicktoCall(id){
	var w=370;
	var h=450;
	var leftPos=(screen.width)?(screen.width-w)/2:100;
	var topPos=(screen.height)?(screen.height-h)/2:100;
	var	settings='width='+w+',height='+h+',top='+topPos+',left='+leftPos+',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';
	var sUrl='http://www.nascomms.com/ccConnect/Dialer.aspx?clientId=' + id;
	var ccWindow=window.open(sUrl,'ClickCalling',settings);
	ccWindow.focus();
}			

//on page load, give focus if control can be found
//checks for existence of control before giving it focus.
function giveFocus(ctl){
	var x = document.getElementById(ctl);
	if(typeof(x) != "undefined")
	{
		x.focus();
	}
}

//don't let the submit button for a call be clicked twice
function validate(frm){
	var clickCount = frm.clickCount.value;
	var err = "";
	// check to see if the user click count is 0
	if (clickCount != '0'){
		alert(mess); //message is set in the dialer on load as it is language specific
		return false;
	}
	else{
		frm.clickCount.value = '1';
		frm.submit();
	}
}

//where do we send the second page?
function redirect(url) {
	setTimeout("location.href='http://"+url+"'", 3500);
}

/*
used if specific clients can't control the window size, then we do.
allow for three toolbars (includes tabs, but tabs wont show on a new window)
*/
function sizeMe() {
	var w = 0;
	var h = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		w = window.innerWidth;
		h = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
		w = document.documentElement.clientWidth; 
		h = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		w = document.body.clientWidth; 
		h = document.body.clientHeight;
	}
	if(h > 450){
		window.resizeTo(410,620);
	}
}
//-->