// Generic Popup Script
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=500');");
}



// Open links in external window for XHTML 1.0 Strict compliancy
// To make a link open in external window add the "rel" attribute to the <a> tag
// and set its value to "external" example:
//     <a href="http://www.google.com" rel="external">Google</a>
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}



function handleEnter(e){

	try{
		if(window.event.keyCode==13){
			
			prepopulatefields();
			}
		}
		catch(e){
			
			}
	
	}
	

// Image rollover - for use please make sure image names follow the following name scheme:
// Idle Image:  image_i.gif
// Hover Image: image_o.gif
// File extension and anything before the _i. does not matter so long as it is consistent between
// the two states (e.g. "image_i.gif" and "hoverimage_o.gif" does not work)
// Usage:
// <img src="image_i.gif" alt="" onmouseover="rollOver(this)" onmouseout="rollOut(this)" />
var oldImage = "";
function rollOver(oImg) {
	oldImage = oImg.src;
	var newImage = oldImage.replace("_i.","_o.");
	oImg.src = newImage;
}
function rollOut(oImg) {
	oImg.src = oldImage;
}

function init_home(){
	externalLinks();
	//alert('loaded');
	}
	

function prepopulatefields(){
	xajax_pre_populate_custom_deal(xajax.getFormValues(document.forms[0]));
	}
	
	
	
// Replace input field with default value on blur if nothing was entered
// Usage: <input type="text" value="Default Value" onfocus="clearText(this)" onblur="replaceText(this)" />
function clearText(thefield) {
	if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
 
function replaceText(thefield) {
	if (thefield.value=="") { thefield.value = thefield.defaultValue }
}

