// JavaScript Document

/*** CUFON ***/
/** ----------------------------------------------------- **/
Cufon.replace('.font_gotham',{ fontFamily: 'gotham', hover: true });

/*** COMPARE POPUP FUNCTIONS ***/
/** ----------------------------------------------------- **/
function confirm_delete(url) {
	var answer = confirm("Clear all items?")
		if(answer){
			window.location = url;
		} else { }															
}

function confirm_delete_single(formName) {
	var answer = confirm("Remove this item?")
	if(answer){
		eval("document.forms."+formName+".submit();")
	} else { }															
 }

function popup_window(pageURL, title, width) {
	var left = (screen.width  - width)/2;
	var newWindow = window.open(pageURL, title, "status=0, toolbar=0, location=0, menubar=0, directories=0, scrollbars=1, width="+width+", left="+left);
	if (window.focus) {newWindow.focus()}
}


/*** FORM EFFECTS ***/
/** ---------------------------------------------------- **/
// Input text disapperars/reappears
function myFocus(element) {
 	if (element.value == element.defaultValue) { element.value = ''; }
}

function myBlur(element) {
	if (element.value == '') { element.value = element.defaultValue; }
} 


/*** GALLERY EFFECTS ***/
/** ---------------------------------------------------- **/
// Image swap function
function switch_product_img(divName, totalImgs) {
	for (var i=1; i<=totalImgs; i++) {
		var showDivName = 'image_' +  i;
		var showObj = document.getElementById(showDivName);
		if (showDivName == divName)
			showObj.style.display = 'block';
		else
			showObj.style.display = 'none';
		}
	}


/*** NAVIGATION EFFECTS ***/
/** ---------------------------------------------------- **/
jQuery(document).ready(function () {
	//Drop Downs							
	jQuery("ul.cat-children li:even").addClass("alt");
	jQuery('li.cat-nav').hover(
	  function (e) {
		jQuery(this).find('ul').hoverFlow(e.type, { opacity: 'show' }, 'medium');
	  },
	  function (e) {
		jQuery(this).find('ul').hoverFlow(e.type, { opacity: 'hide' }, 'medium');
	  }
	);
	
	jQuery("ul.page-children li:even").addClass("alt");
	jQuery('li.page-nav').hover(
	  function (e) {
		jQuery('ul.page-children').hoverFlow(e.type, { opacity: 'show' }, 'medium');
	  },
	  function (e) {
		jQuery('ul.page-children').hoverFlow(e.type, { opacity: 'hide' }, 'medium');
	  }
	);
});	
