		Hor1 = new Array();

		Hor2 = new Array();

		HorImages = new Array("Home", "KingSolomonLegend", "KingSolomonTales", "Wholesale", "ContactUs");

		for (i=0; i < HorImages.length; i++) {

				Hor1[i] = new Image();

				Hor1[i].src = "images/HorizMenu/" + HorImages[i] + "2.gif";

				Hor2[i] = new Image();

				Hor2[i].src = "images/HorizMenu/" + HorImages[i] + "1.gif";

		}

		Ver1 = new Array();

		Ver2 = new Array();

		VerImages = new Array("KingSolomonSeals", "LoveAmulets", "HealthAmulets", "ProtectionAmulets", "ProsperityAmulets", "PersonalAmulets", "ZodiacAmulets", "SignUpForNews", "CreateAccount", "Login");

		for (i=0; i < HorImages.length; i++) {

				Ver1[i] = new Image();

				Ver1[i].src = "images/VerMenu/" + VerImages[i] + "2.gif";

				Ver2[i] = new Image();

				Ver2[i].src = "images/VerMenu/" + VerImages[i] + "1.gif";

		}

		function ChangeImage(imageName, menu, regup) {

			has2 = imageName.indexOf("2"); // id = Articles or Articles2

			image = (has2 > -1) ? imageName.substr(0, has2) : imageName;  

		  document.images[imageName].src = "images/" + menu + "/" + image + regup + ".gif";

		}



    function fixPNG(myImage) {

        var arVersion = navigator.appVersion.split("MSIE")

        var version = parseFloat(arVersion[1])

        if ((version >= 5.5) && (version < 7) && (document.body.filters)) 

        {

           var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""

    	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""

    	   var imgTitle = (myImage.title) ? 

    		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "

    	   var imgStyle = "display:inline-block;" + myImage.style.cssText

    	   var strNewHTML = "<span " + imgID + imgClass + imgTitle

                      + " style=\"" + "width:" + myImage.width 

                      + "px; height:" + myImage.height 

                      + "px;" + imgStyle + ";"

                      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

                      + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"

                   //   alert( myImage.src);

    	   myImage.outerHTML = strNewHTML	  

        }

    }


    function createAjaxObj() {

      var httprequest=false

      if (window.XMLHttpRequest) {

        httprequest=new XMLHttpRequest()

        if (httprequest.overrideMimeType)

          httprequest.overrideMimeType('text/xml')

        }

      else if (window.ActiveXObject) {

             try {

               httprequest=new ActiveXObject("Msxml2.XMLHTTP");

               } 

            catch (e) {

              try {

                httprequest=new ActiveXObject("Microsoft.XMLHTTP");

                }

              catch (e) {}

              }

            }

        return httprequest

        }

      var ajaxpack=new Object()

      ajaxpack.basedomain="http://"+window.location.hostname

      ajaxpack.ajaxobj=createAjaxObj()

      ajaxpack.ajaxobj=createAjaxObj()

      var parameters=parameters+"&ajaxcachebust="+new Date().getTime()

      if (this.ajaxobj) {

        this.ajaxobj.onreadystatechange=callbackfunc

        this.ajaxobj.open('GET', url+"?"+parameters, true)

        this.ajaxobj.send(null)

        }

    ajaxpack.postAjaxRequest=function(url, parameters, callbackfunc) {

      ajaxpack.ajaxobj=createAjaxObj()

      if (this.ajaxobj) {

        this.ajaxobj.onreadystatechange = callbackfunc;

        this.ajaxobj.open('POST', url, true);

        this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        this.ajaxobj.setRequestHeader("Content-length", parameters.length);

        this.ajaxobj.setRequestHeader("Connection", "close");

        this.ajaxobj.send(parameters);

        }

      }

    function processGetPost() {

      var myajax=ajaxpack.ajaxobj

      if (myajax.readyState == 4) {

        if (myajax.status==200 || window.location.href.indexOf("http")==-1) {

          if (parseInt(myajax.responseText)) { location.href='/wholesale/categories/'; } else { alert('Invalid login name or password'); }

          }

        }

      }

    function processGetPass() {

      var myajax=ajaxpack.ajaxobj

      if (myajax.readyState == 4) {

        if (myajax.status==200 || window.location.href.indexOf("http")==-1) {

          if (parseInt(myajax.responseText)) { location.href='/wholesale/retrieval/'; } else { alert('Invalid login name or Email address'); }

          }

        }

      }

    function getPostParameters() {

      var loginvalue=document.getElementById("login_form").login.value

      var passvalue=document.getElementById("login_form").password.value

      var poststr = "login=" + encodeURI(loginvalue) + "&pass=" + encodeURI(passvalue)

      return poststr

      }

    function getPassParameters() {

      var loginvalue=document.getElementById("login_form").login.value

      var emailvalue=document.getElementById("login_form").email.value

      var poststr = "login=" + encodeURI(loginvalue) + "&email=" + encodeURI(emailvalue)

      return poststr

      }

    function validate_old(f) {

        if (f.login.value.length<3 || f.password.value.length<3) {

			alert('Please provide your login name and password')

			return false

			}

		var poststr=getPostParameters()

		ajaxpack.postAjaxRequest('/wholesale/', poststr, processGetPost)

		return false

        }

      function validate_email(email) {

        var emailRegxp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,4}){1,2}$/

        return (emailRegxp.test(email))

        }

      function validate_new(f) {

		message = '';

        if (f.name.value.length<3) message += '\n- Full Name'

        if (f.company.value.length<3) message += '\n- Company Name'

        if (f.business.value.length<3) message += '\n- Business ID'

        if (f.address.value.length<3) message += '\n- Address'

        if (f.country.value.length<3) message += '\n- Country'

        if (f.phone.value.length<3) message += '\n- Phone Number'

        if (f.email.value.length<3) message += '\n- Email Address'

        if (f.confirm.value.length<3) message += '\n- Email Confirmation'

        if (f.email.value.length>2 && f.confirm.value.length>2 && f.email.value.length==f.confirm.value.length && !validate_email(f.email.value)) message += (message?'\n\nIn addition, t':'T')+'he provided Email doesn\'t seems to be valid'

        if (f.email.value.length>2 && f.confirm.value.length>2 && f.email.value.length!=f.confirm.value.length) message += (message?'\n\nIn addition, t':'T')+'he provided Email doesn\'t match the Confirmation Email'

		if (message) {

			alert('Please fix the following details:\n'+message)

			return false

			}

		return true

        }
