
var child;
function open_window(url,width, height, resize, scroll) 
{
	//var left = (screen.width/2)-(width/2) -5;
	//var top = (screen.height/2)-(height/2)-35;
	width = screen.width;
	height = screen.height;
	var left = 0;
	var top = 0;
	
	//child = window.open(url,"newwindow", "width=" + width + ",height=" + height + ",resizable=" + resize + ",scrollbars=" + scroll + ",screenX=" + left +",screenY=" + top +",left=" + left +",top=" + top );

	child = window.open(url,"newwindow", "width=" + width + ",height=" + height + ",resizable=1,scrollbars=1,screenX=" + left +",screenY=" + top +",left=" + left +",top=" + top );
	
	//location.href = url;
}


var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';
		//var html = '<printReady>\n';

		if (document.getElementsByTagName != null)
		{
			//var headTags = document.getElementsByTagName("head");
			var headTags = document.getElementsByTagName("printReady");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		//html += '\n</HE' + 'AD><title>Print</title>\n<BODY>\n';
		html += '\n<title>Print</title>\n';
	//html += "\n<link href=\'style1/style1.css\' rel=\'stylesheet\' type=\'text/css\'>";
	//html += "\n<link href=\'../style/traveller1.css\' rel=\'stylesheet\' type=\'text/css\'>";

	html+="\n<style>\n.input01\n {	BORDER : none; FONT-WEIGHT: normal; FONT-SIZE: 12px;FONT-STYLE: normal; FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif; TEXT-DECORATION: none	}\n td{font-family:Arial,sans-serif,Tahoma; font-size:12px}\n</style> \n</HEAD>\n <BODY>"
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</BODY>\n</HTML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
		printWin.close();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}


function findObj(theObj, theDoc)
{
	var p, i, foundObj;
	  
	if(!theDoc) theDoc = document;
	if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
	{
		theDoc = parent.frames[theObj.substring(p+1)].document;
		theObj = theObj.substring(0,p);
	}
	if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
	for (i=0; !foundObj && i < theDoc.forms.length; i++) 
		foundObj = theDoc.forms[i][theObj];
	for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
		foundObj = findObj(theObj,theDoc.layers[i].document);
	if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
	  
	return foundObj;
}

function getValue(ctl)
{
	var control = findObj(ctl, document);

	if(control != null)
	{
		return control.value;
	}
	
	return "";
}
