	/*********************************************************************
* Copyright 2008 Amblique :: www.amblique.com :: All Rights Reserved *
**********************************************************************
* JAVASCRIPT AND OTHER SCRIPTING
*********************************************************************/

/**********************************
* jQuery
**********************************/
jQuery(document).ready(function(){

	// PopupWindow :: http://plugins.jquery.com/project/PopupWindow
	var profiles = {
		popupToolsPrint:{height:500,width:600,center:1,scrollbars:1,status:0,resizable:1},
		popupToolsEmail:{height:400,width:500,center:1,scrollbars:1,status:0,resizable:1}
	};
	$(".tool").popupwindow(profiles);
	
	// Applying class "last"
	$(".contentProductDetails .east ul.icons li:last-child").addClass("last");
	$(".elementProductListing #ProductListing_dlProductListing span:last-child").addClass("last");	
});

/**********************************
* Custom scripts
**********************************/

/***** Google toolbar yellow fields Fix *****/
if(window.attachEvent)
window.attachEvent("onload",setListeners);

function setListeners(){
inputList = document.getElementsByTagName("INPUT");
for(i=0;i<inputList.length;i++){
	inputList[i].attachEvent("onpropertychange",restoreStyles);
	inputList[i].style.backgroundColor = "";
}
selectList = document.getElementsByTagName("SELECT");
	for(i=0;i<selectList.length;i++){
		selectList[i].attachEvent("onpropertychange",restoreStyles);
		selectList[i].style.backgroundColor = "";
	}
}
function restoreStyles(){
	if(event.srcElement.style.backgroundColor != "" && event.srcElement.style.backgroundColor != "#a0d0ff"){
		event.srcElement.style.backgroundColor = "#a0d0ff"; /* color of choice for AutoFill */
		document.all['googleblurb'].style.display = "block";
	}
}
/***** Clear Input Text *****/
function clearText(thefield, clearType){ 
	if (thefield.defaultValue==thefield.value) {
		thefield.value = ""
	}		
}

function showHideCtrl(id) {
	var ctrl = document.getElementById(id);		
	if (ctrl.className == "") {
		ctrl.className = "hide";
	} else if (ctrl.className == "hide") {		
		ctrl.className = ""
	}
}