function getObj(name){
//alert(name);
  if (document.getElementById){this.obj = document.getElementById(name);this.style = document.getElementById(name).style;}
  else if (document.all){this.obj = document.all[name];this.style = document.all[name].style;}
  else if (document.layers){this.obj = document.layers[name];this.style = document.layers[name];}
}

function validateForm(form){
	if(form.targetcountry.value=="0"){ alert("You should select a country"); return false;}
	return true;
}
function showVeggies(field){
	vegop = (new getObj("targetveggy")).obj;
	vegop.options.length=1;
	var option = "";
	for (i=0; i < veg.length; i++) {		// add new items
		option = veg[i][0];
		if(field.value=="0") option += " ("+veg[i][1]+")";
		vegop.options[i+1] = new Option(option);
		vegop.options[i+1].value=i;
	}
}
function movemenu()
{
	if (window.innerHeight)
	{
		  pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop
	}
//	if (pos < theTop) pos = theTop;
//	else pos -= 100; //+= 0;
	if (pos > 100) pos -= 100;
	else pos=0;
	if (pos == old)
	{
		menu.style.top = pos+"px";
	}
	old = pos;
	temp = setTimeout('movemenu()',500);
}
function openWindowAndWrite(iname,icap,wsize,hsize,cssfile) {
  wname = '_blank';
  wsize = Math.min(screen.width,(parseInt(wsize, 10) + 20));
  hsize = Math.min(screen.height-70,parseInt(hsize, 10));
  var bldArg = 'width=' + wsize + ',height=' + hsize + ',left=0,top=0,screenX=0,screenY=0';
  bldArg = bldArg + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
 if(!(iname=="")) {
  popupWin=window.open('',wname,bldArg);
  if (!popupWin.opener) { popupWin.opener = self;}
  popupWin.document.open();
  popupWin.document.writeln("<html><head>");
  popupWin.document.writeln("<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>");
  popupWin.document.writeln("<link rel='stylesheet' type='text/css' href='" + cssfile + ".css'>");
  popupWin.document.writeln("<title>" + icap + "</title>");
  popupWin.document.writeln("<SCRIPT language='JavaScript'>");
  popupWin.document.writeln("if (window.focus) {");
  popupWin.document.writeln(" self.focus();");
  popupWin.document.writeln("}");
  popupWin.document.writeln("</SCRIPT>");
  popupWin.document.writeln("</head>");
  popupWin.document.writeln("<body class='popupImage'>");
  popupWin.document.writeln("<center>");
  popupWin.document.writeln("<a href='#' onClick='self.close()'><img src='" + iname + "' border=0></a><br>");
  popupWin.document.writeln("<p><div class='plainText'><table border='0' cellspacing='0' cellpadding='0'><tr>");
  popupWin.document.writeln("<td width='" + wsize + "' height='40' valign='middle' align='center' class='contentColumn'><b>");
  popupWin.document.writeln(icap);
  popupWin.document.writeln("</b></td></tr></table></div>");
  popupWin.document.writeln("</center></body></html>");
  popupWin.document.close();
 } else {
  popupWin=window.open('http://www.tetsi.com',wname,bldArg);
  if (!popupWin.opener) { popupWin.opener = self;}
 }
}

function printVersionPopUp(prms) {
   var url = "print.php?"+prms;
   hsize = screen.height-200;
   param = "toolbar=yes,menubar=yes,location=no,status=no,scrollbars=yes,resizable=yes,width=" + 650 + ",height=" + hsize;
   compose_window=window.open(url, '_blank', param);
   if (!compose_window.opener) compose_window.opener=self;
}
// Script Source: CodeLifter.com
// Copyright 2003
// SETUPS:
// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 50;

defaultWidth  = 620;
defaultHeight = 620;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape" || navigator.appName=="Opera")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
imageURL = imageURL.replace(/\ /g,"%20");
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>html, body {margin:0px; height: 100%; overflow: hidden;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">');
writeln('<a href="#" onClick="self.close()"><img name="George" src='+imageURL+' style="display:block" alt=""></a></body></html>');
close();		
}}
