var _color = "black";

function initMenus() {
	$('ul.menu ul').hide();
	$.each($('ul.menu'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});
	$('ul.menu li a').click(
		function() {
			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}

/*
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
noerror();
}

function noError(){return true;}
window.onerror = noError;

 $(this).bind("contextmenu", function(e) {
                e.preventDefault();
            });
            
            
            //Disable select-text script (IE4+, NS6+)
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

*/

 $(this).bind("contextmenu", function(e) {
                e.preventDefault();
            });


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
if (window.attachEvent){
	window.attachEvent("onload", correctPNG); 
}

var _menuhtml = "<ul id=\"menu1\" class=\"menu\" rel='123'>     <li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-prom-w.png\" alt=\"Prom\" border=\"0\" /></a>    <ul>      <li>        <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">          <tr>            <td width=\"12\" style=\"background:url(images/s_con1.png) no-repeat; height:24px;\"></td>            <td class=\"searcbg\"><input class=\"searcht\" type=\"text\" name=\"stext\" id=\"formatStylesarray\" border=\"0\" size=\"20\" onfocus=\"this.value=(this.value==\'enter style #\') ? \'\' : this.value;\" onblur=\"this.value=(this.value==\'\') ? \'enter style #\' : this.value;\"/></td>            <td width=\"19\" style=\"background:url(images/s_con3.png) no-repeat; height:24px;\"></td>          </tr>        </table>      </li>   <li><a href=\"http://www.sherrihill.com/prom-dresses.php\" class=\"subnudge\">2012 Prom Dresses</a></li><li><a href=\"http://www.sherrihill.com/New-York-Fashion-Week.php\" class=\"subnudge\">New York Fashion Week</a></li><li><a href=\"http://www.sherrihill.com/Kendall_Jenner.php\" class=\"subnudge\">Kendall Jenner</a></li><li><a href=\"http://www.sherrihill.com/short-prom-dress.php\" class=\"subnudge\">Short Prom Dresses</a></li><li><a href=\"http://www.sherrihill.com/homecoming-dress.php\" class=\"subnudge\">Homecoming Dresses</a></li><li><a href=\"http://www.sherrihill.com/Sherri_Hill_Couture.php\" class=\"subnudge\">Couture</a></li><li><a href=\"http://www.sherrihill.com/sherrihill-catalog.php\" class=\"subnudge\">2011 Catalog</a></li>   </ul><li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-celebrities-w.png\" alt=\"Celebrity Dresses\" border=\"0\" /></a>    <ul>      <li><a href=\"http://www.sherrihill.com/celebrity.php\" class=\"subnudge\">On the Red Carpet</a></li>    </ul>   </li>  <li><a href=\"/http://www.sherrihill.com/videos.php\" class=\"subnudge\"><img src=\"/images/nav-videos-w.png\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-peoplepress-w.png\" width=\"71\" height=\"22\" border=\"0\" /></a>    <ul> <li><a href=\"http://www.sherrihill.com/press_editorials.php\" class=\"subnudge\">Press Editorials</a></li><li><a href=\"http://www.sherrihill.com/contact.php\" class=\"subnudge\">Press Inquiries</a></li>    </ul>  </li>  <li><a href=\"http://www.sherrihill.com/prom-dress-shops.php\" class=\"subnudge\"><img src=\"/images/nav-wheretobuy-w.png\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/content.php?id=sherri-hill\" class=\"subnudge\"><img src=\"/images/nav-about-w.png\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/content.php?id=registration\" class=\"subnudge\"><img src=\"/images/nav-authenticity-w.png\" border=\"0\" /></a></li><li><table border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td><iframe src=\"//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fsherrihilldresses&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=63&amp;appId=212785502862\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:63px;\" allowTransparency=\"true\"></iframe></td><td><a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-count=\"vertical\" data-via=\"SherriHill\">Tweet</a><script type=\"text/javascript\" src=\"//platform.twitter.com/widgets.js\"></script></td><td><div id=\"___plusone_0\" style=\"height: 60px; width: 50px; display: inline-block; text-indent: 0pt; margin: 0pt; padding: 0pt; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline;\"><iframe scrolling=\"no\" frameborder=\"0\" width=\"100%\" title=\"+1\" vspace=\"0\" tabindex=\"-1\" style=\"position: static; left: 0pt; top: 0pt; width: 50px; margin: 0px; border-style: none; height: 60px; visibility: visible;\" src=\"https://plusone.google.com/u/0/_/+1/fastbutton?url=http%3A%2F%2Fwww.sherrihill.com&amp;size=tall&amp;count=true&amp;annotation=&amp;hl=en-US&amp;jsh=r%3Bgc%2F24805178-fa62ba1b#id=I1_1320122721421&amp;parent=http%3A%2F%2Fwww.sherrihill.com&amp;rpctoken=422971750&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe\" name=\"I1_1320122721421\" marginwidth=\"0\" marginheight=\"0\" id=\"I1_1320122721421\" hspace=\"0\" allowtransparency=\"true\"></iframe></div></td></tr></table></li></ul>";

var _menuwhitehtml = "<ul id=\"menu1\" class=\"menu\" rel='4567'>        <ul>          </ul>      <li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-prom.png\" alt=\"Prom\" border=\"0\" /></a>    <ul>    <li>        <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">          <tr>            <td width=\"12\" style=\"background:url(images/s_con1.png) no-repeat; height:24px;\"></td>            <td class=\"searcbg\"><input class=\"searcht\" type=\"text\" name=\"stext\" id=\"formatStylesarray\" border=\"0\" size=\"20\" onfocus=\"this.value=(this.value==\'enter style #\') ? \'\' : this.value;\" onblur=\"this.value=(this.value==\'\') ? \'enter style #\' : this.value;\"/></td>            <td width=\"19\" style=\"background:url(images/s_con3.png) no-repeat; height:24px;\"></td>          </tr>        </table>      </li>      <li><a href=\"http://www.sherrihill.com/prom-dresses.php\" class=\"subnudge\">2012 Prom Dresses</a></li><li><a href=\"http://www.sherrihill.com/New-York-Fashion-Week.php\" class=\"subnudge\">New York Fashion Week</a></li><li><a href=\"http://www.sherrihill.com/Kendall_Jenner.php\" class=\"subnudge\">Kendall Jenner</a></li><li><a href=\"http://www.sherrihill.com/short-prom-dress.php\" class=\"subnudge\">Short Prom Dresses</a></li><li><a href=\"http://www.sherrihill.com/homecoming-dress.php\" class=\"subnudge\">Homecoming Dresses</a></li><li><a href=\"http://www.sherrihill.com/Sherri_Hill_Couture.php\" class=\"subnudge\">Couture</a></li><li><a href=\"http://www.sherrihill.com/sherrihill-catalog.php\" class=\"subnudge\">2011 Catalog</a></li>          </ul> <li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-celebrities.png\" alt=\"Celebrity Dresses\" border=\"0\" /></a>    <ul>      <li><a href=\"http://www.sherrihill.com/celebrity.php\" class=\"subnudge\">On the Red Carpet</a></li>    </ul>              </li>  <li><a href=\"http://www.sherrihill.com/videos.php\" class=\"subnudge\"><img src=\"/images/nav-videos.png\" alt=\"Dress Videos\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/\" class=\"subnudge\"><img src=\"/images/nav-peoplepress.png\" width=\"71\" height=\"22\" border=\"0\" /></a>    <ul> <li><a href=\"http://www.sherrihill.com/press_editorials.php\" class=\"subnudge\">Press Editorials</a></li><li><a href=\"http://www.sherrihill.com/contact.php\" class=\"subnudge\">Press Inquiries</a></li> </li>          </ul>      </li>  <li><a href=\"http://www.sherrihill.com/prom-dress-shops.php\" class=\"subnudge\"><img src=\"/images/nav-wheretobuy.png\" alt=\"Where to Buy\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/content.php?id=sherri-hill\" class=\"subnudge\"><img src=\"/images/nav-about.png\" alt=\"About Sherri Hill\" border=\"0\" /></a></li>  <li><a href=\"http://www.sherrihill.com/content.php?id=registration\" class=\"subnudge\"><img src=\"/images/nav-authenticity.png\" alt=\"Prom dress authenticity\" border=\"0\" /></a></li><li><table border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td><iframe src=\"//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fsherrihilldresses&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=63&amp;appId=212785502862\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:63px;\" allowTransparency=\"true\"></iframe></td><td><a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-count=\"vertical\" data-via=\"SherriHill\">Tweet</a><script type=\"text/javascript\" src=\"//platform.twitter.com/widgets.js\"></script></td><td><div id=\"___plusone_0\" style=\"height: 60px; width: 50px; display: inline-block; text-indent: 0pt; margin: 0pt; padding: 0pt; background: none repeat scroll 0% 0% transparent; border-style: none; float: none; line-height: normal; font-size: 1px; vertical-align: baseline;\"><iframe scrolling=\"no\" frameborder=\"0\" width=\"100%\" title=\"+1\" vspace=\"0\" tabindex=\"-1\" style=\"position: static; left: 0pt; top: 0pt; width: 50px; margin: 0px; border-style: none; height: 60px; visibility: visible;\" src=\"https://plusone.google.com/u/0/_/+1/fastbutton?url=http%3A%2F%2Fwww.sherrihill.com&amp;size=tall&amp;count=true&amp;annotation=&amp;hl=en-US&amp;jsh=r%3Bgc%2F24805178-fa62ba1b#id=I1_1320122721421&amp;parent=http%3A%2F%2Fwww.sherrihill.com&amp;rpctoken=422971750&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe\" name=\"I1_1320122721421\" marginwidth=\"0\" marginheight=\"0\" id=\"I1_1320122721421\" hspace=\"0\" allowtransparency=\"true\"></iframe></div></td></tr></table></li></ul>";

jQuery(document).ready(function($){
	if(_color=="black"){
		//jQuery(".menu").load('/menu.html', function() {onMenuLoad()});
		jQuery(".menu").html(_menuhtml);
		onMenuLoad();
		$('[rel=123]').show();
		jQuery(".buyer").html("");
	}else{
		jQuery(".menu").html(_menuwhitehtml);
		onMenuLoad();
//		jQuery(".menu").load('/menu-white.html', function() {onMenuLoad()});
		$('[rel=4567]').show();
		jQuery(".buyer").html("");
	}

});

function onMenuLoad(){
	
}

