
var product_page_setheight;
window.addEvent('domready', function() {	
										 


if (document.all) { 
 document.oncontextmenu = function() { return false; };  
}else{
	document.body.addEvent('contextmenu',function(e) {e.stop();});
}



	new UvumiDropdown('dropdown');
//var myMenu = new MenuMatic();

/*
    new Autocompleter.Request.JSON('search_box', './livesearch.php', {
        'postVar': 'search'
    });
 */
/*
	$$('.move_ani').each(function(img) {
	img.addEvent('mouseover', function() { 
	//this.fade('0.7');
	this.tween('padding-left','0','10') ; 	
	});
	img.addEvent('mouseout', function() { 
	//this.fade('1');
	this.tween('padding-left','0') ; 
	});
  });
	*/
	
		$$('.fade').each(function(img) {
	img.addEvent('mouseover', function() { 
	this.fade('0.7'); 
	});
	img.addEvent('mouseout', function() { 
	this.fade('1'); 
	});
  });
	//$('advert_info').position({relativeTo: 'advert_listitem'}); 
	
	
	
	
	
	if(product_page_setheight==1){
		
		$('product_main_current_thumb').setStyle('height','380px');
	var p_left_h = $('product_main_left').getStyle('height');
	var p_left_r = $('product_main_right').getStyle('height');
		$$('.thumb_img').setStyle('width','50px');
     p_left_h = p_left_h.replace(/px/,"")
     p_left_r = p_left_r.replace(/px/,"")
	// alert(p_left_h);
	 //alert(p_left_r);
	 if(Number(p_left_r)<Number(p_left_h)){
			$('product_main_right').setStyle('height',$('product_main_left').getStyle('height'));	
	 }else{
			$('product_main_left').setStyle('height',$('product_main_right').getStyle('height'));	
		 }
	 
	}
  
 	$$('.thumb_img').each(function(img) {
	img.addEvent('mouseover', function() { 
		$('product_main_current_thumb').setStyle('height','380px');
		
img.getParent().getParent().getParent().getParent().getParent().getParent().setStyle('border','1px solid #999');
	var replace_src= img.src.replace(/resize2/,"resize1");
		$('product_main_current_thumb_img').setAttribute("src",replace_src);
	var replace_link=img.getParent().href.replace(/resize2/,"resize1");
	$('product_main_current_thumb_link').setAttribute("href",replace_link);
	});
	img.addEvent('mouseout', function() { 
img.getParent().getParent().getParent().getParent().getParent().getParent().setStyle('border','1px solid #ccc');

	});
  }); 
 		//$$('.art_content_div').setStyle('background-color','#dddddd'); 
  
  /*------------------------------Mouse Over border ----------------------*/
  	$$('.art_cd_desc').each(function(img) {
									 
									 
	img.addEvent('mouseover', function() { 
	this.setStyle('background-color','#f6f6f6'); 
	});
	img.addEvent('mouseout', function() { 
	this.setStyle('background-color','#ffffff'); 
	});
	img.addEvent('click', function() { 
	window.location.href=this.getElements('a.d_red');
	//this.toggle();
	});
  });
	
	
	  	$$('.product_category_li').each(function(img) {
									 
									 
	img.addEvent('mouseover', function() { 
	this.setStyle('background-color','#f6f6f6'); 
	});
	img.addEvent('mouseout', function() { 
	this.setStyle('background-color','#ffffff'); 
	});
	img.addEvent('click', function() { 
	window.location.href=this.getElements('a.bold');
	//this.toggle();
	});
  });
		
 
   /*------------------------------Mouse Over border ----------------------*/	



	$$('.ttt').each(function(img) {
	img.addEvent('mousedown', function() { 
	var yoid = $(this.rel);
	
	if(yoid.style.display=='block'){
	yoid.setStyle('display','none');
}else{
	yoid.setStyle('display','block');
}

	});
	  });
	  
	  
  
});	/*----- Window load ---*/








  
var ccc = 0;
	function expexp(opp_id,set_id,ex_txt,col_txt){
	var opp_id= new String(opp_id)	
	var set_id= new String(set_id)	
	var ex_txt= new String(ex_txt)	
	var col_txt= new String(col_txt)	
	var op_all =$$('.'+opp_id);
	var op_all_id =$(set_id);
//$$('.array_input').setStyle('display','block');
	if(ccc == 0){
	op_all.setStyle('display','block');
	op_all_id.innerHTML=col_txt;
	ccc=1;
	}else 	if(ccc == 1){
	op_all.setStyle('display','none');
	op_all_id.innerHTML=ex_txt;
		ccc=0;
	}
	
}
    







/*

var xmlhttp;

function LiveSearch(str,isroot)
{
if (str.length==0)
  {
  document.getElementById("livesearch").innerHTML="";
  return;
  }
xmlhttp=GetXmlHttpObject()
if (xmlhttp==null)
  {
  alert ("Your browser does not support XML HTTP Request");
  return;
  }
if (isroot==0)  { seturl='../livesearch.php';  }else{seturl='livesearch.php';}
xmlhttp.onreadystatechange=stateChanged1 ;
xmlhttp.open("POST",seturl,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
xmlhttp.send("q="+str+"&sid="+Math.random());


}
*/
function stateChanged1()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function	check_search(){
	  str =  document.getElementById("search_box").value;
 	 if(str=='' || str==searchrmsg){
		document.getElementById("search_box").focus();
	return false;
	}else{
	return true;
		}
}


function clear_result(){
//document.getElementById("livesearch").innerHTML="";
}




function update_result(haveVal){
document.getElementById("search_box").value=haveVal;
//document.getElementById("livesearch").innerHTML="";
document.search_form.submit();
}

var notfirst=1;
function resetInput(){
if(notfirst==1){document.getElementById("search_box").value=""; notfirst=0;}
}


