function __doPostBack(eventTarget, eventArgument) 
{
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		theform = document.Form1;
	}
	else 
	{
		theform = document.forms["Form1"];
	}
	theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
	theform.__EVENTARGUMENT.value = eventArgument;
	theform.submit();
} 

function trim(strText) 
{
	
	return strText.replace(/^\s+/,'').replace(/\s+$/,'');
}

	
	function ResetRegistrationForm(){
	document.forms['Form1'].elements['Txtaddress'].value = "";
    document.forms['Form1'].elements['txtcompanyname'].value = "";
    document.forms['Form1'].elements['Txtemail'].value = "";
    document.forms['Form1'].elements['Txtpersonname'].value = "";
    document.forms['Form1'].elements['txtphone'].value = "";
    document.forms['Form1'].elements['Txttitle'].value = "";
    document.forms['Form1'].elements['Txtpassword'].value = "";
    document.forms['Form1'].elements['Txtconfpass'].value = "";
    document.forms['Form1'].elements['drpregisteredin'].selectedIndex = 0;
    document.forms['Form1'].elements['txtcomregnumber'].value ="";
        }

function validateRegistrationForm(){

	var txtcompanyname = document.forms['Form1'].elements['txtcompanyname']
	var txtphone = document.forms['Form1'].elements['txtphone']
	var txtcomregnumber = document.forms['Form1'].elements['txtcomregnumber']
	var Txtpersonname = document.forms['Form1'].elements['Txtpersonname']
	var Txtaddress = document.forms['Form1'].elements['Txtaddress']
	var Txttitle = document.forms['Form1'].elements['Txttitle']
	var Txtemail = document.forms['Form1'].elements['Txtemail']
	var Txtpassword = document.forms['Form1'].elements['Txtpassword']
	var Txtconfpass = document.forms['Form1'].elements['Txtconfpass']
	var drpregisteredin = document.forms['Form1'].drpregisteredin

	if ((trim(txtcompanyname.value)==null)||(trim(txtcompanyname.value)=="")){
		alert("Please enter your company name")
		txtcompanyname.focus()
		return false
	}
	if(txtphone.value.search("[^0-9+-. ]")!=-1){
		                alert("Please enter a valid phone number")
		                txtphone.focus();
		                return false
	 }
	 
	 
	if ((trim(txtcomregnumber.value)==null)||(trim(txtcomregnumber.value)=="")){
			alert("Please enter your company registration number")
			txtcomregnumber.focus()
			return false
	}
	
	if(drpregisteredin.selectedIndex== 0){
		alert("Please select the country where your company is registered.")
		drpregisteredin.focus()
		return false
	}
	
	if ((trim(Txtaddress.value)==null)||(trim(Txtaddress.value)=="")){
			alert("Please enter your address")
			Txtaddress.focus()
			return false
	}
	if ((trim(txtphone.value)==null)||(trim(txtphone.value)=="")){
		alert("Please enter your phone number")
		txtphone.focus()
		return false
	}
	if ((trim(Txtpersonname.value)==null)||(trim(Txtpersonname.value)=="")){
				alert("Please enter your name")
				Txtpersonname.focus()
				return false
	}



	
//	if(Txtpersonname.value.search("[^a-zA-Z'-. ]")!=-1){
//		                alert("Please enter valid contact person name")
//				Txtpersonname.focus();
//				return false
//	 }
      var  output=""
      input1 =Txtpersonname.value
      for(i=0; i<input1.length; ++i)
		{
			if(output != "");
			output = input1.charCodeAt(i);
				for(p=33;p<65;p++)
				{
				if(output==p)
				{
				alert("Please enter valid contact person name.");
				Txtpersonname.focus();
				return false;
				break;
				}
				}
				for(k=91;k<97;k++)
				{
				if(output==k)
				{
				alert("Please enter valid contact person name.");
							Txtpersonname.focus();
							return false;

				break;
				}
				}
				for(k=123;k<127;k++)
				{
				if(output==k)
				{
				alert("Please enter valid contact person name.");
				Txtpersonname.focus();
				return false;
				break;
				}
				}
				if((output==145)||(output==146))
				{
				alert("Please enter valid contact person name.");
					Txtpersonname.focus();
					return false;

		 		}
		}

	 
	 
	if ((trim(Txttitle.value)==null)||(trim(Txttitle.value)=="")){
				alert("Please enter your title")
				Txttitle.focus()
				return false
	    }
	
	// if(Txttitle.value.search("[^a-zA-Z'-. ]")!=-1){
	//	 	                alert("Please enter a valid title")
	//	 			Txttitle.focus();
	//	 			return false
	//	 }
	
	 	 
	if ((trim(Txtemail.value)==null)||(trim(Txtemail.value)=="")){
				alert("Please enter your email address")
				Txtemail.focus()
				return false
	   }
	 
  if ((Txtemail.value).match(/^[A-Za-z0-9._+%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/) == null)
  {
         alert("Please enter valid email address.");
         Txtemail.focus();
		 return false
  }
	
	
	if ((trim(Txtpassword.value)==null)||(trim(Txtpassword.value)=="")){
					alert("Please enter your password")
					Txtpassword.focus()
					return false
	    }
	
	
	  if ((Txtpassword.value.length) < 6){
	 		 	 	 	                alert("Please input a password contains at least 6 characters.")
	 		 	 	 			Txtpassword.focus();
	 		 	 	 			return false
	     }
	 
	  if(Txtpassword.value.search("[^0-9a-zA-Z]")!=-1){
		 	                alert("Password should be alphanumeric")
		 			Txttitle.focus();
		 			return false
		 }
	
	
	    
	   if ((trim(Txtconfpass.value)==null)||(trim(Txtconfpass.value)=="")){
	    			     alert("Please enter confirm password")
	    			     Txtconfpass.focus()
	    			     return false
	      } 
	 
	 if((Txtconfpass.value) != (Txtpassword.value)){
	                            alert("Confirm password should be same as password")
	                            Txtconfpass.focus();
	 	 	      return false
	 	  }	
	 	 	       
	showLayer();
	return true
          }
	
	
	


function validateEditRegistrationForm(){
	
	var txtcompanyname = document.forms['Form1'].elements['txtcompanyname']
	var txtphone = document.forms['Form1'].elements['txtphone']
	var txtcomregnumber = document.forms['Form1'].elements['txtcomregnumber']
	var Txtpersonname = document.forms['Form1'].elements['Txtpersonname']
	var Txtaddress = document.forms['Form1'].elements['Txtaddress']
	var Txttitle = document.forms['Form1'].elements['Txttitle']
	var Txtemail = document.forms['Form1'].elements['Txtemail']
	var Txtpassword = document.forms['Form1'].elements['Txtpassword']
	var Txtconfpass = document.forms['Form1'].elements['Txtconfpass']
	var drpregisteredin = document.forms['Form1'].elements['drpregisteredin']
	
		
	
	if ((trim(txtcompanyname.value)==null)||(trim(txtcompanyname.value)=="")){
		alert("Please enter your company name")
		txtcompanyname.focus()
		return false
	}
	if ((trim(txtphone.value)==null)||(trim(txtphone.value)=="")){
		alert("Please enter your phone number")
		txtphone.focus()
		return false
	}
	
	if(txtphone.value.search("[^0-9+-. ]")!=-1){
		                alert("Please enter a valid phone number")
		                txtphone.focus();
		                return false
	 }
	 
	
	if ((trim(Txtaddress.value)==null)||(trim(Txtaddress.value)=="")){
			alert("Please enter your address")
			Txtaddress.focus()
			return false
	}
	if ((trim(Txtpersonname.value)==null)||(trim(Txtpersonname.value)=="")){
				alert("Please enter your contact person name")
				Txtpersonname.focus()
				return false
	}
	 
	
	//if(Txtpersonname.value.search("[^a-zA-Z'-. ]")!=-1){
	//	                alert("Please enter valid Contact person name")
	//			Txtpersonname.focus();
	//			return false
	//}
	 
	 var  output=""
      input1 =Txtpersonname.value
      for(i=0; i<input1.length; ++i)
		{
			if(output != "");
			output = input1.charCodeAt(i);
				for(p=33;p<65;p++)
				{
				if(output==p)
				{
				alert("Please enter valid contact person name.");
				Txtpersonname.focus();
				return false;
				break;
				}
				}
				for(k=91;k<97;k++)
				{
				if(output==k)
				{
				alert("Please enter valid contact person name.");
							Txtpersonname.focus();
							return false;

				break;
				}
				}
				for(k=123;k<127;k++)
				{
				if(output==k)
				{
				alert("Please enter valid contact person name.");
				Txtpersonname.focus();
				return false;
				break;
				}
				}
				if((output==145)||(output==146))
				{
				alert("Please enter valid contact person name.");
					Txtpersonname.focus();
					return false;

		 		}
		}
	 
	 
	if ((trim(Txttitle.value)==null)||(trim(Txttitle.value)=="")){
				alert("Please enter your title")
				Txttitle.focus()
				return false
	}
	
	// if(Txttitle.value.search("[^a-zA-Z'-. ]")!=-1){
	//	 	                alert("Please enter a valid title")
	//	 			Txttitle.focus();
	//	 			return false
    //}
     	 
	if ((trim(Txtemail.value)==null)||(trim(Txtemail.value)=="")){
				alert("Please enter your email address")
				Txtemail.focus()
				return false
	}
	
 if ((Txtemail.value).match(/^[A-Za-z0-9._+%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/) == null)
  {
         alert("Please enter valid email address.");
         Txtemail.focus();
		 return false
  }
	
	
	if ((trim(Txtpassword.value)==null)||(trim(Txtpassword.value)=="")){
					alert("Please enter your password")
					Txtpassword.focus()
					return false
	}
	
	
	  if ((Txtpassword.value.length) < 6){
	 		 	 	 	             alert("Please input a password contains at least 6 characters.")
	 		 	 	 			Txtpassword.focus();
	 		 	 	 			return false
	 }
	    if(Txtpassword.value.search("[^0-9a-zA-Z]")!=-1){
		 	                alert("Password should be alphanumeric")
		 			Txttitle.focus();
		 			return false
	 }	    
	      if ((trim(Txtconfpass.value)==null)||(trim(Txtconfpass.value)=="")){
	    			     alert("Please enter confirm password")
	    			     Txtconfpass.focus()
	    			     return false
	} 
	 
	 if((Txtconfpass.value) != (Txtpassword.value)){
	                            alert("Confirm password should be same as password")
	                            Txtconfpass.focus();
	 	 	      return false
	 } 
	showLayer();
	 return true
	
 }	
 
 function ReseteditRegistrationForm(){
	document.forms['Form1'].elements['Txtaddress'].value = "";
    document.forms['Form1'].elements['txtcompanyname'].value = "";
    document.forms['Form1'].elements['Txtemail'].value = "";
    document.forms['Form1'].elements['Txtpersonname'].value = "";
    document.forms['Form1'].elements['txtphone'].value = "";
    document.forms['Form1'].elements['Txttitle'].value = "";
    document.forms['Form1'].elements['Txtpassword'].value = "";
    document.forms['Form1'].elements['Txtconfpass'].value = "";
            }	
            
    function forgetpasswordvalidation()
	{        
    var txtloginid = document.forms['Form1'].elements['TxtloginID']
	   
         if ((trim(txtloginid.value)==null)||(trim(txtloginid.value)=="")){
			alert("Please enter your Login ID first before clicking on Forget Password. Please contact our support team (Was_Support@adidas-group.com) if you do not remember your Login ID.")
			txtloginid.focus()
			return false
		}   
            
            
         	 if(txtloginid.value.length != 9 ||
		 txtloginid.value.substring(0,3).toUpperCase() != 'ADI' || 
		 (txtloginid.value.substring(3,6).search("[^0-9]")!=-1) || 
		 txtloginid.value.substring(6,7) != '-'|| 
		 (txtloginid.value.substring(7,9).search("[^0-9]")!=-1))
		 {
		 
		 			                alert("Please enter a valid Login ID")
		 					txtloginid.focus();
		 					return false
		 }
		 
		 
	}        
            
	function validateSupplierLogin()
	{
	
	var txtloginid = document.forms['Form1'].elements['TxtloginID']
	var txtpassword = document.forms['Form1'].elements['txtpassword']
	
	
	
	
	
		if ((trim(txtloginid.value)==null)||(trim(txtloginid.value)=="")){
			alert("Please enter your Login ID")
			txtloginid.focus()
			return false
		}
		
 
		 if(txtloginid.value.length != 9 ||
		 txtloginid.value.substring(0,3).toUpperCase() != 'ADI' || 
		 (txtloginid.value.substring(3,6).search("[^0-9]")!=-1) || 
		 txtloginid.value.substring(6,7) != '-'|| 
		 (txtloginid.value.substring(7,9).search("[^0-9]")!=-1))
		 {
		 
		 			                alert("Please enter a valid Login ID")
		 					txtloginid.focus();
		 					return false
		 }
		 if ((trim(txtpassword.value)==null)||(trim(txtpassword.value)=="")){
		 			alert("Please enter your password")
		 			txtpassword.focus()
		 			return false
	    }
	 
	 
	   if ((txtpassword.value.length) < 6){
		alert("Invalid password, password must be 6 to 10 characters")
		txtpassword.focus();
		return false
		}
	 
	return true
	}
	
	function getBrowserHeight() {
                var intH = 0;
                var intW = 0;
               
                if(typeof window.innerWidth  == 'number' ) {
                   intH = window.innerHeight;
                   intW = window.innerWidth;
                } 
                else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                    intH = document.documentElement.clientHeight;
                    intW = document.documentElement.clientWidth;
                }
                else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    intH = document.body.clientHeight;
                    intW = document.body.clientWidth;
                }

                return { width: parseInt(intW), height: parseInt(intH) };
                }  

            function setLayerPosition() {
                var shadow = document.getElementById("shadow");
                var question = document.getElementById("question");

                var bws = getBrowserHeight();
                shadow.style.width = bws.width + "px";
                shadow.style.height = bws.height + "px";

                question.style.left = parseInt((bws.width - 150) / 2);
                question.style.top = parseInt((bws.height - 200) / 2);

                shadow = null;
                question = null;
            }

            function showLayer() {
                setLayerPosition();

                var shadow = document.getElementById("shadow");
                var question = document.getElementById("question");
 
                shadow.style.display = "block"; 
                question.style.display = "block";

                shadow = null;
                question = null;        
            }
            
            function hideLayer() {
                var shadow = document.getElementById("shadow");
                var question = document.getElementById("question");
 
                shadow.style.display = "none"; 
                question.style.display = "none";

                shadow = null;
                question = null; 
	      }          
/*Added for Supplier Recruitment changes*/	
	/*Functions to toggle language* Start*/
function changeLangToggleText()
{
var OriginalURL = window.location.toString();
    if ((getLanguage()) == "en")
    {
        document.getElementById("languageLink").innerHTML="DEUTSCH";
    }
    else
    {
        document.getElementById("languageLink").innerHTML="ENGLISH";
    }
}

function languageToggle()
{
    var OriginalURL = window.location.toString();
    if ((getLanguage()) == "en")
    {
        var NewURL=OriginalURL;
        NewURL = NewURL .replace("=en","=de");
        NewURL = NewURL .replace("=EN","=de");
        NewURL = NewURL .replace("=En","=de");
        NewURL = NewURL .replace("=eN","=de");
    }
    else
    {
        var NewURL=OriginalURL;
        NewURL = NewURL.replace("=de","=en");
        NewURL = NewURL.replace("=DE","=en");
        NewURL = NewURL.replace("=De","=en");
        NewURL = NewURL.replace("=dE","=en");
    }
    window.location=NewURL;
}
function getLanguage()
{

   var OriginalURL = window.location.toString();
   OriginalURL = OriginalURL.toLowerCase(); 
   var Language='';
    if ((OriginalURL.search("=de")) ==-1)
    {
        return Language = "en";
    }
    else
    {
        return Language= "de";
    }
}

/*Functions to toggle language* End*/

/*Functions for Gloabl Search Start*/  
function check_Key_Press(event,adidasGrpRLSite,lang)
   {
   
    if(null == event )
    {
        event = window.event;
    }
    
     if(event.keyCode=="13")
      {
		 if((null != document.getElementById("q")) && ('undefined' != document.getElementById("q")))
		   {
				var theForm = document.forms['theForm'];
				var param = document.getElementById("inputSearch").value;
				var searchURL;
				param = param.replace(/"/g,'%22');
				param = param.replace(/&/g,'%26');
				param = param.replace(/'/g,'%27');
				if (lang=="en")
				{
					searchURL =  adidasGrpRLSite + 'SearchResults.aspx?q=' + param + '&search=Search&output=xml_no_dtd&client=adiGroup_CorpRL&site=adiGroup_RL&lr=lang_en&proxystylesheet=adiGroup_CorpRL&filter=0&restrict=lang_en"';
				}
				else
				{
					searchURL =  adidasGrpRLSite + 'SearchResults.aspx?q=' + param + '&search=Search&output=xml_no_dtd&client=adiGroup_CorpRL_de&site=adiGroup_RL &lr=lang_de&proxystylesheet=adiGroup_CorpRL_de&filter=0&restrict=lang_de"';
				}
				theForm.action=searchURL;
		   }
		  else
		  {
			val_search(adidasGrpRLSite,lang);
		  }
	   }
	 }
	 
	function val_search(adidasGrpRLSite,lang)
	{
	 if(document.getElementById("inputSearch").value=="")
	 {
	  document.getElementById("inputSearch").focus();
	  return false;
	 }
	 else
	 {
		var param = document.getElementById("inputSearch").value;
		var searchURL;
		param = param.replace(/"/g,'%22');
		param = param.replace(/&/g,'%26');
		param = param.replace(/'/g,'%27');
				if (lang=="en")
				{
					searchURL =  adidasGrpRLSite + 'SearchResults.aspx?q=' + param + '&search=Search&output=xml_no_dtd&client=adiGroup_CorpRL&site=adiGroup_RL&lr=lang_en&proxystylesheet=adiGroup_CorpRL&filter=0&restrict=lang_en"';
				}
				else
				{
					searchURL =  adidasGrpRLSite + 'SearchResults.aspx?q=' + param + '&search=Search&output=xml_no_dtd&client=adiGroup_CorpRL_de&site=adiGroup_RL &lr=lang_de&proxystylesheet=adiGroup_CorpRL_de&filter=0&restrict=lang_de"';
				}
		document.write('');
		window.location = searchURL;
		
	 }
	}
function checkEnter(e)
						{
							var characterCode;
							if(e && e.which)
							{
								e = e;
								characterCode = e.which;
							}
							else
							{
								e = event;
								characterCode = e.keyCode;
							}
							if(characterCode == 13)
							{
								fnSubmitSearch();
							}


						}

function fnSubmitSearch()
	{

		 if(document.formSearch.q.value=="")
						 {

						  document.formSearch.q.focus();
						  return false;
						 }
				else
				{
					if("<%=locale%>"=="de")
					{
						document.formSearch.action="/de/local/search.asp";
					}
					else
					{
							document.formSearch.action="/en/local/search.asp";
					}
					document.formSearch.submit();
		}
	}
	
	
	var WindowObjectReference = null; // global variable
	
	function adidasShareThisPopup(url)
	
	{
	
	  if(WindowObjectReference == null || WindowObjectReference.closed)
	
	  {
	
	    WindowObjectReference = window.open(url,
	
	   "adidasShareThis", "resizable=yes,scrollbars=yes,status=yes");
	
	  }
	
	  else
	
	  {
	
	    WindowObjectReference.focus();
	
	  };
	
}
/*Functions for Gloabl Search End*/  

/*Added for Supplier Recruitment changes*/
