//Front end Java Script File
var type_of_browser  =false;
var browser_version = '';
jQuery(document).ready(function()
{
	type_of_browser = jQuery.browser["msie"];
	browser_version = jQuery.browser.version;
	//jQuery(".submenu_class").hover
/*	jQuery(".menu_class").hover(
      function () {
		  //alert("hi");
       // $(this).append($("<span> ***</span>"));
	   		//jQuery(".submenu_class").css("display","none");//alert(this.id);
	   		jQuery("#"+this.id+" .submenu_class").css("display","block");
      }, 
      function () {
		  //alert("bi"+jQuery("#"+this.id+" .submenu_class").css("display"));
        //$(this).find("span:last").remove();
	   		jQuery("#"+this.id+" .submenu_class").css("display","none");
      }
    );
*/
});
/*$(document).ready(function()
{
  //first slide down and blink the message box
  $("#object").animate({
  top: "0px"
  }, 2000 ).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);

  //close the message box when cross red image is clicked
  $("#close_message").click(function()
  {
     $("#object").fadeOut("slow");
  });
});
*/
function validate_product(select_box_id)
{
	//alert("hii"+select_box_id);
	var select_box_value = '';
	var str=true;
	
	if(document.getElementById("product_attribute_select_"+select_box_id))
	{
		select_box_value = document.getElementById("product_attribute_select_"+select_box_id).value;
		
		
		if(select_box_value=='header')
		{
			str = false;
			var box_name = "product_attribute_select_"+select_box_id;//alert(box_name);
			
			var speed_of_effect=200;
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect ).fadeOut(100);
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect ).fadeIn(100);
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect ).fadeOut(100);
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect ).fadeIn(100);
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect).fadeOut(100);
			jQuery("#"+box_name).animate({ top: "0px" }, speed_of_effect ).fadeIn(100);
			
			//if(navigator.appName=="Microsoft Internet Explorer")
/*			if(type_of_browser == true && browser_version== "6.0")
			{
				jQuery("#"+box_name).hide("slow").show("slow").hide("slow").show("slow");
			}
			else
			{
				jQuery("#"+box_name).animate({
			  top: "0px"
			  }, 500 ).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);
			}
*/		}
	}
	
	
	return str;
}
function edit_validate_product(select_box_id)
{
	//alert("hii"+select_box_id);
	var select_box_value = '';
	var str=true;
	
	if(document.getElementById("edit_product_attribute_select_"+select_box_id))
	{
		select_box_value = document.getElementById("edit_product_attribute_select_"+select_box_id).value;
		
		if(select_box_value=='header')
			str = false;
	}
	
	return str;
}
function selectHide()
{
}





/*overlay script*/


if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) 
{
	window.attachEvent("onload", alphaBackgrounds);
}
function alphaBackgrounds()
{
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++)
	{
			var cls=document.all[i].className;
			if(cls.indexOf("trans_png")==-1)
			{
			}
			else
			{
				var bg = document.all[i].currentStyle.backgroundImage;
			if (itsAllGood && bg)
			{
				if (bg.match(/\.png/i) != null)
				{
					var mypng = bg.substring(5,bg.length-2);
					document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
					document.all[i].style.backgroundImage = "url('')"; // change this to your own gif
				}
			}
		}
	}
}



jQuery(document).ready(function()
{
	//alert(w3_path_prefix);
/*	jQuery('.dynamicMenu a').textImageCreator({
		// define url for sending text to a file
		postUrl : w3_path_prefix+"dynamic_menu.php",
		// variable for 
		dt : "menuText",
		
		widthUrl : w3_path_prefix+"background_width.php"
		
	}); 
*/	
	
/*	jQuery(".dynamicMenu a").each(function(i)
	 {


		menuText=this.text;					
		menuText=escape(document.getElementById(this.id).innerHTML);
	//	menuText=document.getElementById(this.id).innerHTML;
		menuId=this.id;

		//setting padding left for each menu
		if(i==0)
		imgPaddingLeft=0;
		else
		imgPaddingLeft=10;
		
		
		
		document.getElementById(this.id).style.backgroundImage='url("'+w3_path_prefix+'dynamic_menu.php?menuText='+menuText+'&imgPaddingLeft='+imgPaddingLeft+'")';

		//document.getElementById('transparentImage').style.background='url("transparent_image.php?trans_file_name='+transImage+'&left='+left+'&top='+imgTop+'&fontSize='+fontSize+'&fontColor='+fontColor+'&text='+text+'") no-repeat';	
	
	 jQuery.ajax({
		   url: w3_path_prefix+"background_width.php",
		   type:'POST',
		   data:'menuText='+menuText+'&menuId='+menuId+'&imgPaddingLeft='+imgPaddingLeft,
		   success: function(res) 
		   {
			   			 
			   resArr=res.split("####");

			   jQuery("#"+resArr[2]).css("width", resArr[0]+"px");			
		   

   		},
   		error: function (){
			//alert('something went wrong');
			}
		 });
	  	
		//setting text-indent for the text in the menus
		document.getElementById(this.id).style.textIndent=-10000+'px';
										
											   
	 });	
*/

	
});


