function openwin(url,mwidth,mheight){
	var opts='status=0,resizable=1';
	if(mwidth && mheight)opts+=',width='+mwidth+',height='+mheight+',menubar=0';

        if (document.all&&window.print) //if ie5
		eval('window.open(url,"",opts)');
        else
		eval('window.open(url,"",opts)');
}//eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")');

function openWin(file,name,h,w){
	window.open(file,name,"height="+h+",width="+w+",resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");
}

function getAgreement(file){
	h='600';
	w='800';
	window.open(file,'agreement',"height="+h+",width="+w+",resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	//window.showModelessDialog('ims_agreement.php',"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px");
}

function openWindow( popupURL){
	return window.open( popupURL, 'openWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0' );
}

function openWindow( popupURL, winName){
	return window.open( popupURL, winName, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1' );
}

function openWindow(popupURL, w, h ){
	return window.open( popupURL,'_blank','width='+w+',height='+h+',resizable=1,scrollbars=1,menubar=0');
}

function printWindow( popupURL){
	return window.open( popupURL, 'printWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1' );
}


function printImage( popupURL){
	return window.open( popupURL, 'printImage', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0' );
}

function FullScreen(){

	var adjWidth;

	var adjHeight;
	
	if((detectOS() == 'Macintosh') && (detectBrowser() == 'Netscape')) {
		adjWidth = 20;
		adjHeight = 35;
	}
	
	if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE')) {
		adjWidth = 20;
		adjHeight = 35;
		winOptions = 'fullscreen=yes';
	}

	if((detectOS() == 'Windows') && (detectBrowser() == 'Netscape')) {
		adjWidth = 30;
		adjHeight = 30;
	}

	if(detectVersion() < 4) {
		self.location.href = 'oldbrowser.html';
	} else {
		var winWidth = screen.availWidth - adjWidth;
		var winHeight = screen.availHeight - adjHeight;
		var winSize = 'width=' + winWidth + ',height=' + winHeight;
		var thewindow = window.open('site.html', 'windowName', winSize);
		thewindow.moveTo(0,0);
	}
}
function detectOS(){

	if(navigator.userAgent.indexOf('Win') == -1) {
		OS = 'Macintosh';
	} else {
		OS = 'Windows';
	}
	return OS;
}
function detectBrowser(){
	if(navigator.appName.indexOf('Netscape') == -1) {
		browser = 'IE';
	} else {
		browser = 'Netscape';
	}
	return browser;
}

function detectVersion(){
	version = parseInt(navigator.appVersion);
	return version;
}