var alertTimerId = 0;

function showShoppingDiva(){
	clearTimeout ( alertTimerId );
	//if(document.getElementById('idminicart1').style.display=='none'){
		document.getElementById('idminicart1').style.display='block';
//	}else{
	//	document.getElementById('idminicart1').style.display='none';
//	}
}
function checkThisValue(val){
	// This bit is commented out because we dont' need the indicator. 03112011 - FLO-73
	//if(val.length>2){
	//	document.getElementById('search').style.background="url( "+SKIN_URL+"images/indicator.gif) no-repeat right center";
	//}else{
	//	document.getElementById('search').style.background='none';
	//}
}
function SearchAutoSubmit(){
		document.getElementById('search_mini_form').action='';
		document.location.href = BASE_MAIN+'?q='+document.getElementById('search').value;
}
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

jQuery(document).ready(function () {
	setTimeout(function() { jQuery('#idminicart1').fadeOut('slow'); }, 3000);
});

function get_object(id) {
	var object = null;
	if( document.layers )	{			
		object = document.layers[id];
	} else if( document.all ) {
		object = document.all[id];
	} else if( document.getElementById ) {
		object = document.getElementById(id);
	}
	return object;
}
function is_child_of(parent, child) {
	if( child != null ) {			
		while( child.parentNode ) {
			if( (child = child.parentNode) == parent ) {
				return true;
			}
		}
	}
	return false;
}
function fixOnMouseOut(element, event, JavaScript_code) {
	var current_mouse_target = null;
	if( event.toElement ) {				
		current_mouse_target 			 = event.toElement;
	} else if( event.relatedTarget ) {				
		current_mouse_target 			 = event.relatedTarget;
	}
	if( !is_child_of(element, current_mouse_target) && element != current_mouse_target ) {
		eval(JavaScript_code);
	}
}

function show_message(message) {
	get_object('status').innerHTML = message;
}
function hideCartDiv(){
	$('idminicart1').style.display='none';
}
function showLanguageDiva(){
	clearTimeout ( alertTimerId );
	$('form-language-blockid').toggleClassName('hover');
	$('form-language-popupid').style.display='block';
	$('form-language-popupid').toggleClassName('hover');
}
function hideLanguageDiv(){
	$('form-language-blockid').toggleClassName('hover');
	$('form-language-popupid').style.display='none';
	$('form-language-popupid').toggleClassName('hover');
}
function RedirectCategory(url){
	document.location.href=url;
}
function checkforvisibility(divid){
	if($(divid).style.display=='none'){
		getElementByClassnew('showcontent');
		$(divid).style.display='block';
	}else{
		$(divid).style.display='none';
		getElementByClassnew('showcontent');
	}
}
function checkforvisibility1(divid){
	if($(divid).style.display=='block'){
		$(divid).style.display='none';
	}else{
		$(divid).style.display='block';
	}
}
function clearallLayers(){
	getElementByClassnew('showcontent');
}
function getElementByClassnew(theClass) {
	//Create Array of All HTML Tags
	var allHTMLTags=document.getElementsByTagName("*");
	
	//Loop through all tags using a for loop
	for (i=0; i<allHTMLTags.length; i++) {
	
		//Get all tags with the specified class name.
		if (allHTMLTags[i].className==theClass) {
		
			//Place any code you want to apply to all
			//pages with the class specified.
			//In this example is to “display:none;” them
			//Making them all dissapear on the page.
			
			allHTMLTags[i].style.display='none';
		
		}
	}
}
function getElementByClass(theClass) {
	//Create Array of All HTML Tags
	var allHTMLTags=document.getElementsByTagName("*");
	
	//Loop through all tags using a for loop
	for (i=0; i<allHTMLTags.length; i++) {
	
		//Get all tags with the specified class name.
		if (allHTMLTags[i].className==theClass) {
		
			//Place any code you want to apply to all
			//pages with the class specified.
			//In this example is to “display:none;” them
			//Making them all dissapear on the page.
			
			allHTMLTags[i].style.display='none';
		
		}
	}
}
function ShowNewEvent5(id){
	//sleep(1500);
	$(id+'-hover').show();
	$(id).hide();
}
function getElementByClass5(theClass) {
	var allHTMLTags=document.getElementsByTagName("div");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
				allHTMLTags[i].show();
		}
	}
}
function getElementByClass15(theClass) {
	var allHTMLTags=document.getElementsByTagName("div");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
				allHTMLTags[i].hide();
		}
	}
}

function hideContent5(){
	$$('li.innerProHover').each(Element.hide);
	$$('li.innerProducts').each(Element.show);
}
function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
	if ((new Date().getTime() - start) > milliseconds){
	  break;
	}
  }
}
function ShowCatDetailwait(catid){
	getElementByClass('innerCatHover');
	ShowCatDetail(catid);
}

function disableAllcat(){
	getElementByClass('innerCatHover');
}

function ShowNewEvent(id){
	//sleep(1500);
	$(id+'-hover').show();
	$(id).hide();
}
function getElementByClass1(theClass) {
	var allHTMLTags=document.getElementsByTagName("div");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
				allHTMLTags[i].style.display='block';
		}
	}
}
function getElementByClass20(theClass) {
	var allHTMLTags=document.getElementsByTagName("div");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
				allHTMLTags[i].style.border='0px';
				allHTMLTags[i].style.width='228px';
				allHTMLTags[i].style.height='294px';
		}
	}
}
function hideContent3(){
	$$('div.innerCatHover').each(Element.hide);
	$$('div.innerCategories').each(Element.show);
}
