
//if (window == window.top) {
//	window.location.href = "http://www.vitech-int.com/Test";
//}


var wndPCBE;
var year;
var ns = navigator.appName == "Netscape";
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();

var is_fb = (agt.indexOf('firefox')!=-1);

var now= new Date();

if (ns) {
	year = 1900 + now.getYear();
}else {
	year = now.getYear();
}


function GoRequest(strPNR)
{
	var width, height;
	var strUrl;

      if (self.screen){
		if (screen.width>1000){
			width= 840;
			height= 350;
		} else {
			width= 615;
			height= 350;
		}
	}

	if (ns) {width=width-10};	

	if (ns) {
		strUrl = 'quotes.php?';
	} else {
		strUrl = 'quotes.php?';
	}
	strUrl = strUrl + 'action=' + 'append';
	strUrl = strUrl + '&pnr=' + strPNR;
	
	strUrl = strUrl.replace(/ /g,'%20');

	wndPCBE = window.open(strUrl, "PcbeRequestList","resizable=1,scrollbars=1");
	wndPCBE.resizeTo(width,height);
	wndPCBE.moveTo(130,238);
	wndPCBE.focus();
		
}
var picwin;
var bigpicwin;

function setpicwin() {
	picwin = null;
}

function loadPic(artnr, pic){	
	var strUrl = 'viewpic.php?viewartnr=' + artnr;
	if( typeof pic != 'undefined' ) {
		strUrl = strUrl + "&pic=" + pic;
	}	
	if (picwin) picwin.close();
	picwin=window.open(strUrl,"_blank","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1,left=200,top=150,width=600,height=560");

}

function loadSPPic(artnr){	
	var strUrl = 'http://www.vitech-int.com/viewsppic.php?viewartnr=' + artnr;
	
	if (picwin) picwin.close();
	picwin=window.open(strUrl,"_blank","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1,left=200,top=150,width=600,height=560");

}

function loadBigPic(artnr){	
	var strUrl = 'console.php?img=' + artnr;
	
	//if (picwin) picwin.close();
	bigpicwin=window.open(strUrl,"_blank","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1,left=200,top=150,width=600,height=350");

}

var i = 1;

function goMail(strPNR)
{
	var width, height;
	var strUrl;
	var ns = navigator.appName == "Netscape";

      if (self.screen){
		if (screen.width>1000){
			width= 570;
			height= 580;
		} else {
			width= 570;
			height= 580;
		}
	}

	if (ns) {width=width-10};	

	strUrl = 'friend.php?';
	strUrl = strUrl + 'pnr=' + strPNR;
	
	strUrl = strUrl.replace(/ /g,'%20');

	wndMail = window.open(strUrl, "MailFriend","resizable=1,scrollbars=1");
	wndMail.resizeTo(width,height);
	wndMail.moveTo(100,80);
	wndMail.focus();
		
}

function goSPMail(strPNR)
{
	var width, height;
	var strUrl;
	var ns = navigator.appName == "Netscape";

      if (self.screen){
		if (screen.width>1000){
			width= 570;
			height= 610;
		} else {
			width= 570;
			height= 610;
		}
	}

	if (ns) {width=width-10};	

	strUrl = 'spfriend.php?';
	strUrl = strUrl + 'pnr=' + strPNR;
	
	strUrl = strUrl.replace(/ /g,'%20');

	wndMail = window.open(strUrl, "MailFriend","resizable=1,scrollbars=1");
	wndMail.resizeTo(width,height);
	wndMail.moveTo(100,60);
	wndMail.focus();
}		

function goPage(intPage, cat, manf, ttype, pager) {
	var strUrl;
	
	//document.frmBrowse.page.value = intPage;
	//document.frmBrowse.submit();

	strUrl = 'eqindex.php?';
	strUrl = strUrl + '&page=' + intPage;
	strUrl = strUrl + '&category=' + cat;
	strUrl = strUrl + '&lbxManufacturer=' + escape(manf);
	strUrl = strUrl + '&lbxType=' + ttype;
	strUrl = strUrl + '&lbxPager=' + pager;
	
	//alert(strurl);

	strUrl = strUrl.replace(/ /g,'%20');
	//strUrl = escape(strUrl);

	//parent.document.location=strUrl;
	document.location=strUrl;
}

function goSPPage(intPage, cat, manf, ttype, pager) {
	var strUrl;
	
	//document.frmBrowse.page.value = intPage;
	//document.frmBrowse.submit();

	strUrl = 'speqindex.php?';
	strUrl = strUrl + '&page=' + intPage;
	strUrl = strUrl + '&category=' + cat;
	strUrl = strUrl + '&lbxManufacturer=' + escape(manf);
	strUrl = strUrl + '&lbxType=' + ttype;
	strUrl = strUrl + '&lbxPager=' + pager;
	
	//alert(strurl);

	strUrl = strUrl.replace(/ /g,'%20');
	//strUrl = escape(strUrl);

	//parent.document.location=strUrl;
	document.location=strUrl;
}

//added for neo - open popup for virtual tour
function goVT() {
	var width, height, wndVT;

	wndVT = window.open("virtualtour.htm", "VirtualTour","toolbar=0,location=0,menubar=0,scrollbars=0,left=100,top=50,width=700,height=380");
	
}

//added for neo - open popup for worldmap global offices
function goGO() {
	var width, height, wndGO;

	wndGO = window.open("globaloffices.htm", "GlobalOffices","toolbar=0,location=0,menubar=0,scrollbars=1,resizable=1,left=100,top=20,width=790,height=570");
	
}


//open print quotecart window
function goPrint()
{
	var width, height, wndPrint;
	var strUrl;
	var ns = navigator.appName == "Netscape";

      if (self.screen){
		if (screen.width>1000){
			width= 740;
			height= 580;
		} else {
			width= 740;
			height= 580;
		}
	}

	if (ns) {width=width-10};	

	strUrl = 'printquotes.php';
	//strUrl = strUrl + '?pnr=' + strPNR;
	
	strUrl = strUrl.replace(/ /g,'%20');

	wndPrint = window.open(strUrl, "PrintQuotes","resizable=1,scrollbars=1");
	wndPrint.resizeTo(width,height);
	wndPrint.moveTo(50,80);
	wndPrint.focus();
		
}
