//do the whole color thing
var url = "getArtworkProof.inc.php?";

function getHTTPObject() 
{
	var xmlhttp;
  	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
	{
    	try 
		{
      		xmlhttp = new XMLHttpRequest();
    	} 
		catch (e) 
		{
      		xmlhttp = false;
		}
  	}
  	return xmlhttp;
}
var http = getHTTPObject();



function changeData() 
{
	var timeVar = new Date().getTime();
	var artWorkNum = document.getElementById('artworkNumber').value.toUpperCase()
	
	http.open("GET", url + 'artworkNumber=' + artWorkNum + '&time=' + timeVar, true);
	document.getElementById('bodyTd').height = parseInt(document.getElementById('bodyTd').height) + 100;
	  
	http.onreadystatechange = handleHttpResponse;
	http.send(null);
	
}	


function handleHttpResponse() 
{
	if (http.readyState == 4) 
	{
    	results = http.responseText;
		document.getElementById('artworkImageHolder').innerHTML = results;
		
	}
}


function openFormPage()
{
	window.open('generateOrderForm.php?artworkNumber=' + document.getElementById('artworkNumber').value +'&price='+document.getElementById('price').value+'&duedate='+document.getElementById('duedate').value+'&payto='+document.getElementById('payto').value+'&shirt='+document.getElementById('shirtcolor').value+'&printcolor_1='+document.getElementById('printcolor_1').value+'&printcolor_2='+document.getElementById('printcolor_2').value+'&printcolor_3='+document.getElementById('printcolor_3').value+'&printcolor_4='+document.getElementById('printcolor_4').value+'&backcolor_1='+document.getElementById('backcolor_1').value+'&backcolor_2='+document.getElementById('backcolor_2').value+'&backcolor_3='+document.getElementById('backcolor_3').value+'&backcolor_4='+document.getElementById('backcolor_4').value,null,"height=949,width=850,status=no,toolbar=no,menubar=no,location=no,scrollbars=1");
	
}


function openFormPageTwo()
{
	window.open('generateOrderForm.php',null,"height=949,width=850,status=no,toolbar=no,menubar=no,location=no,scrollbars=1");
	
}


function misqDescOverlay()
{
	var viewportwidth;
	var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
  
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
		
	var blank = " ";
	
	document.getElementById('overLayDiv').innerHTML = '<div style="position: absolute; top:0px; left:0px; width:'+viewportwidth+'px; height:'+viewportheight+'px; background:url(overlay.png);"><table width="'+viewportwidth+'" height="'+viewportheight+'" cellpadding="0" cellspacing="0"><tr><td height="10%">&nbsp;</td></tr><tr><td height="90%" valign="top" align="center"><table  width="45%" border="0" cellspacing="0" cellpadding="2" align="center" style="border: solid 1px #000000;"><tr align="left" bgcolor="#f0f0f0"><td width="100%" style="padding:2px;" align="center"><font face="Arial, Helvetica, sans-serif" size="-1"><b>How to use this page</b><br><ul><li>Enter the price of each shirt</li><li>The form due date</li><li>Who to make checks payable to</li><li>The shirt, front, and back print colors you have selected for your qrote</li><li>Enter your art work number and click "Get Artwork"</li><li>After your Artwork Shows click "Generate Form"</li></ul><br><a href="javascript:openFormPageTwo();">View example form</a><br></font><br><input type="button" class="formbutton" value="Close Window" onClick="closeDiv();" style="background-color:#ed9358; border: solid 1px #000000; width:105px;"><br><br></td></tr></table><br>&nbsp;</td></tr></div>';

}


function closeDiv()
{
	document.getElementById('overLayDiv').innerHTML = '&nbsp;';

}
