function over( id ) {
	var i_s = $( id ).src.split('.');
	var f = i_s.length-2;
	var regex = /_ov$/;

	if( i_s[f].match( regex ) ) {
		i_s[f] = i_s[f].replace( regex, '' );
	} else {
		i_s[f] = i_s[f] + '_ov';
	}
	
	var n_i_s = i_s.join( '.' );
	
	try {
		$( id ).src = n_i_s;
	} catch( error ) {
		// Error
	}
}

/* For IE7 */

function scroll_height( id ) {
	
	var height = 413 - 52 - $( id ).offsetHeight;
	
	if ( $( 'scroll_product_brand_head' ) ) {
		height = height - $( 'scroll_product_brand_head' ).offsetHeight + 'px';
	} else {
		height = height + 'px';
	}
	
	return height;
	
}

function changeImage ( id, src, width, height ) {
	
	var oImage = $(id);
	oImage.src = src;
	oImage.style.width = width;
	oImage.style.height = height;
	
	return false;
}

function getDataFromCookie( cookieName ){
	labelName = cookieName;
	var labelLen = labelName.length;
	var cookieData = document.cookie;
	var cLen = cookieData.length;
	var i = 0;
	var cEnd;
	var selected_value = '';
	while (i < cLen) {
		var j = i + labelLen;
		if (cookieData.substring(i,j) == labelName) {
			cEnd = cookieData.indexOf(';',j);
		
		if (cEnd == -1) {
			cEnd = cookieData.length;
		}
		
		selected_value =  unescape(cookieData.substring(j+1, cEnd));
		}
		i++;
	}
	
	return selected_value;
	
}

function setDataToCookie( cookieName, value ){
	var exp = new Date();
	var oneYearFromNow = exp.getTime() + 60000;
	exp.setTime(oneYearFromNow);
	document.cookie = cookieName + "=" + value + "; expires=" + exp.toGMTString() + "; path=/;";
}

function hideTitleDhtmlPopup() {
	
	$( 'dhtml_popup' ).style.display = 'none';
	$( 'popup_layout' ).style.display = 'none';
	setDataToCookie( 'title_dhtml_popup', 1 );
}


function layoutResize() {

	var w = $( 'full_page' ).offsetWidth;
	if ( w < 990 ) { w = 990; }
	var h = $( 'full_page' ).offsetHeight;
	$( 'popup_layout' ).style.width = w + 'px';
	$( 'popup_layout' ).style.height = h + 'px' ;
}