/**
 * jscript template - help to insert elements for templating purposes. Require JQuery library.
 * @created 24 may 2009
 * @version 1.0  
 * @author Felix (ferolen.com)
 */
$(document).ready( function () {
	var AddWrapperPageList = new Array("accountDefault", "accountEditDefault", "addressBookDefault", "accountPassword", "acctNewslettersDefault", "accountNotifications", "accountHistoryDefault", "testimonialDefault", "logoffDefault", "un");

	for (var i = 0; i < AddWrapperPageList.length; i++) {
		var div = $("div#" + AddWrapperPageList[i]);
		if ( div.is("#" + AddWrapperPageList[i]) ) {
			div.addClass("centerBoxWrapper");
			div.append("<div class='clearBoth'></div>");
			break;	
		}
	}

	if ( ! $("div.centerBoxWrapper").next().is(".centerBoxFooter") ) { 
		$("div.centerBoxWrapper").after("<div class='centerBoxFooter'></div>");
	}
} );

// display hidden attributes image on product info page
function showProductInfoAttributeImg(productAttributeOptionId) {
	if (typeof jQuery != 'undefined') {
		$("div.attribImg").hide(); 
		$("div#attribImg" + productAttributeOptionId).show("fast");
	}
}

function Set_Cookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

if ( expires ) {
	expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function Delete_Cookie( name, path, domain ) {
	document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
