var scW = screen.availWidth ? screen.availWidth : screen.width;
var scH = screen.availHeight ? screen.availHeight : screen.height;

function openwindow(url) {
	if (window.name == 'popupImageWindow') {
		window.open	
(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=250,left=250');
	}
	else
		window.open
(url,'productwindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=250,left=250');
}

function openwindowresize(url, width, height) {
	if (width == -1) {
		width = scW;
	}
	if (height == -1) {
		height = scH;
	}
	var top_ = (scH - height)/2;
	var left_ = (scW - width)/2;
	window.open(url,'popupwindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',screenx=150,screeny=150,top='+top_+',left='+left_+'');
}

function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=250,left=250');
}

function popupImageWindowResize(url, width, height) {
	if (width == -1) {
		width = scW;
	}
	if (height == -1) {
		height = scH;
	}
	var top_ = (scH - height)/2;
	var left_ = (scW - width)/2;
	window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',screenx=150,screeny=150,top='+top_+',left='+left_+'');
}

function removeTable(id)
{
	var tbl = document.getElementById(id);
	if(tbl) tbl.parentNode.removeChild(tbl);
}

function resize() {
	if (window.name == 'productwindow') {
	window.moveTo(Math.round((scW-990)/2),Math.round((scH-scH)/2));
	window.resizeTo(990, scH);
	self.focus();
	}
 	else if (window.name == 'popupImageWindow') {
	window.moveTo(Math.round((scW-990)/2),Math.round((scH-scH)/2));
	window.resizeTo(990, scH);
	self.focus();
	}
	if (window.name == 'productwindow') {
		removeTable('mainfoot');
	}
	else if (window.name == 'popupImageWindow') {
		removeTable('mainfoot');
	}
	else {
		removeTable('foot');
	}
}

function resize1() {
	if (window.name == 'productwindow') {
	window.moveTo(Math.round((scW-800)/2),Math.round((scH-650)/2));
	window.resizeTo(800, 650);
	self.focus();
	}
 	else if (window.name == 'popupImageWindow') {
	window.moveTo(Math.round((scW-800)/2),Math.round((scH-650)/2));
	window.resizeTo(800, 650);
	self.focus();
	}
	if (window.name == 'productwindow') {
		removeTable('mainfoot');
	}
	else if (window.name == 'popupImageWindow') {
		removeTable('mainfoot');
	}
	else {
		removeTable('foot');
	}
}

function resize2() {
	if (window.name == 'productwindow') {
	if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }
	var oH = document.images[0].height;
	var oW = document.images[0].width;
	if( !oH || window.doneAlready ) { return; } //in case images are disabled
	window.doneAlready = true; //for Safari and Opera
	var x = window; x.resizeTo( oW, oH );
	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
	if( window.opera && !document.childNodes ) { myW += 16; }
	if( !window.opera ) { x.moveTo(Math.round((scW-10-oW-100)/2),Math.round((scH-65-oH-130)/2)); }
	x.resizeTo( oW = oW + ( ( oW + 100 ) - myW ), oH = oH + ( (oH + 130 ) - myH ) )
	self.focus();
	}
 	else if (window.name == 'popupImageWindow') {
	if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }
	var oH = document.images[0].height;
	var oW = document.images[0].width;
	if( !oH || window.doneAlready ) { return; } //in case images are disabled
	window.doneAlready = true; //for Safari and Opera
	var x = window; x.resizeTo( oW, oH );
	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
	if( window.opera && !document.childNodes ) { myW += 16; }
	if( !window.opera ) { x.moveTo(Math.round((scW-10-oW-100)/2),Math.round((scH-65-oH-130)/2)); }
	x.resizeTo( oW = oW + ( ( oW + 100 ) - myW ), oH = oH + ( (oH + 130 ) - myH ) )
	self.focus();
	}
	if (window.name == 'productwindow') {
		removeTable('mainfoot');
	}
	else if (window.name == 'popupImageWindow') {
		removeTable('mainfoot');
	}
	else {
		removeTable('foot');
	}
}

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-16201435-1");
pageTracker._trackPageview();
} catch(err) {}
