

 function Details(elementId)
   { 
   
           var element = document.getElementById(elementId);
	        if(element.style.display != "block")
	        {	            
		        element.style.display = "block";
		        WebForm_AutoFocus('ctl00_btnSubmit');
		        //Sys.Application.initialize();
	        }
	        else
	        {
		        element.style.display = "none";
	        }  
   }   
   
    function ChangeFocus()
   {  
        var element = document.getElementById('ctl00_loginDetails');
        element.onfocus();
   }  
  
  
  
  
  
   function IsNumeric(txt)
        {
           var ValidChars = "0123456789.";
           var IsNumber=true;
           var Char;   
            var sText1 = txt.value;
           for (i = 0; i < sText1.length && IsNumber == true; i++) 
              { 
              Char = sText1.charAt(i); 
              if (ValidChars.indexOf(Char) == -1) 
                 {        
                 IsNumber = false;
        	      alert("Enter Numbers Only");
                 }
                 else
                 {
                 }
              }
           return IsNumber;   
       }
       
       
          function AvoidSpace(evt,txtname)
        {
          var charCode = (evt.which) ? evt.which : event.keyCode

            if (charCode == 32)
            {           
               return false;
               
               }
               else
               {
           
             return true;
                }
        }
  
     
         function ValidateForm()
        {        
            var theForm = document.forms['aspnetForm'];
            if (!theForm)
            {
                theForm = document.aspnetForm;
            }
            return validateCompleteForm(theForm,'error');
          
        }
  
  
   function DisplayNewImageInWidnow(imgProductLogo) 
    {   
  
       var img = document.getElementById(imgProductLogo).src;   
        var width=(document.getElementById(imgProductLogo).width*2);
        var height=(document.getElementById(imgProductLogo).height*2);
        html = "<HTML><HEAD><TITLE>Photo</TITLE>" 
        +  "</HEAD><BODY LEFTMARGIN=0 "   
        + "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>"   
        + "<IMG src='" 
        + img 
        + "' BORDER=0 width='"+width+"'height='"+height+ "' NAME=image "   
        + "onload='window.resizeTo(500,540)'>"  
        + "</CENTER>"   
        + "</BODY></HTML>"; 
          var winl = (screen.width - width) / 2;
     var wint = (screen.height - height) / 2;
        popup= window.open  ('','image','toolbar=0,location=0,top='+winl+',left='+wint+',directories=0,menuBar=0,scrollbars=0,resizable=1'); 
        popup.document.open(); 
        popup.document.write(html); 
        popup.document.focus(); 
        popup.document.close();
        return false;
   }
   function DisplayNewImageInModelWidnow() 
    {   
   
       var img = document.getElementById('ctl00_ContentPlaceHolder1_hidSrc').value;  
       var divEnlargeProd = document.getElementById('divEnlargeProd'); 
        divEnlargeProd.style.background = "url('"+ img +"') no-repeat center"; 
        divEnlargeProd.style.top = "10%";
        
       /*var imgEnlargeProd = document.getElementById('imgEnlargeProd');  
       imgEnlargeProd.src = img;*/
           
        return false;
   }
   function NewImageInModelWidnow(imgProduct,ProductName) 
    { 
       var img = document.getElementById(imgProduct).src;  
       var divEnlargeProd = document.getElementById('divEnlargeProd');      
        divEnlargeProd.style.background = "url('"+ img +"') no-repeat center"; 
        divEnlargeProd.style.top = "10%";
       $('#dialogTest').data('title.dialog', ProductName);       
       /*var imgEnlargeProd = document.getElementById('imgEnlargeProd');  
       imgEnlargeProd.src = img;*/
           
        return false;
   }
   function showAsMainImage(ProductId)
    {  
        var s = document.getElementById(ProductId).src.toString();
        document.getElementById(ProductId).src=document.getElementById('imgProductLogo').src.toString();
        document.getElementById('imgProductLogo').src=s; 
        return false;
    }
    
    function showAsNewsMainImage(ProductId)
    {  
        var s = document.getElementById(ProductId).src.toString();
        document.getElementById(ProductId).src=document.getElementById('imgNewsLargeImage').src.toString();
        document.getElementById('imgNewsLargeImage').src=s; 
        return false;
    }
    
function ChangeSelectedindex(selectedtext)
{
  if(selectedtext=="Companies")
  {
     var UrlPrefix = location.href;
     var UrlDetails = new Array();
     UrlDetails=UrlPrefix.split("/");              
     UrlPrefix = UrlDetails[0] + "/" + UrlDetails[1] + "/" + UrlDetails[2] + "/";  
     AddhrefForAtoZ(UrlPrefix,"search");   
    
  }
  else 
  {
     var UrlPrefix = location.href;
     var UrlDetails = new Array();
     UrlDetails=UrlPrefix.split("/");              
     UrlPrefix = UrlDetails[0] + "/" + UrlDetails[1] + "/" + UrlDetails[2] + "/";  
     AddhrefForAtoZ(UrlPrefix,"searchproduct");   
 
  }

}

function AddhrefForAtoZ(url,pagename)
{
        document.getElementById("ctl00_ContentPlaceHolder1_href0to9").href = url + pagename + "/0-9/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefA").href = url + pagename + "/a/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefB").href = url + pagename + "/b/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefc").href = url + pagename + "/c/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefd").href = url + pagename + "/d/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefe").href = url + pagename + "/e/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hreff").href = url + pagename + "/f/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefg").href = url + pagename + "/g/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefh").href = url + pagename+ "/h/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefi").href = url + pagename + "/i/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefj").href = url + pagename + "/j/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefk").href = url + pagename + "/k/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefl").href = url + pagename + "/l/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefm").href = url + pagename+ "/m/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefn").href = url + pagename + "/n/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefo").href = url + pagename + "/o/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefp").href = url + pagename + "/p/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefq").href = url + pagename + "/q/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefr").href = url + pagename + "/r/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefs").href = url + pagename + "/s/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hreft").href = url + pagename + "/t/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefu").href = url + pagename + "/u/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefv").href = url + pagename + "/v/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefw").href = url + pagename + "/w/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefx").href = url + pagename + "/x/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefy").href = url + pagename + "/y/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefz").href = url + pagename + "/z/1";
        document.getElementById("ctl00_ContentPlaceHolder1_hrefViewAll").href = url + pagename + "/all/1";
}
  
  

 function chkAuthorization(id,name,value)
{ 
    if(document.getElementById("ctl00_ContentPlaceHolder1_txtCodeCompare").value.toLowerCase()==document.getElementById("ctl00_ContentPlaceHolder1_hideCodeCompare").value.toLowerCase())
    {
        return true;
    }
    return false;
} 
function PageBack()
{  
    history.go(-1);    
  
} 


function WebForm_FireDefaultButton(event, target) {

    if (event.keyCode == 13) {
        var defaultButton;
        var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);

        if (__nonMSDOMBrowser) {
            defaultButton = document.getElementById(target);
        }
        else {
            defaultButton = document.all[target];
        }
        if (defaultButton && typeof(defaultButton.click) != "undefined") {
            defaultButton.click();
            event.cancelBubble = true;
            if (event.stopPropagation) event.stopPropagation();
            return false;
        }
    }
    return true;
}



function installSearchEngineFF() {
 if (window.external && ("AddSearchProvider" in window.external)) {  
   window.external.AddSearchProvider("http://www.ascinfo.co.uk/XML/searchFF2.xml");
 }  else {  
   alert("No search engine support");
 }
}

function installSearchEngineIE() {
 if (window.external && ("AddSearchProvider" in window.external)) {   
   window.external.AddSearchProvider("http://www.ascinfo.co.uk/XML/searchIE.xml");
 }  else {   
   alert("No search engine support");
 }
}

function changeDocumentType()
{

     var UrlPrefix = location.href;
     var UrlDetails = new Array();
     UrlDetails=UrlPrefix.split("/");              
     UrlPrefix = UrlDetails[0] + "/" + UrlDetails[1] + "/" + UrlDetails[2] + "/";  
     var chkBrochures = document.getElementById("ctl00_chkBrochures");
     var chkSpecTexts = document.getElementById("ctl00_chkSpecTexts");
     var chkCadDrawings = document.getElementById("ctl00_chkCadDrawings");    
     var documentType="all";
     if ((chkBrochures.checked == true) && (chkSpecTexts.checked == true) && (chkCadDrawings.checked == false))
                {
                    documentType = chkBrochures.value + "," + chkSpecTexts.value;
                }               
                else if ((chkBrochures.checked == true) && (chkSpecTexts.checked == false) && (chkCadDrawings.checked == true))
                {
                    documentType = chkBrochures.value + "," + chkCadDrawings.value;
                }
                else if ((chkBrochures.checked == false) && (chkSpecTexts.checked == true) && (chkCadDrawings.checked == true))
                {
                    documentType = chkSpecTexts.value + "," + chkCadDrawings.value;
                }
                else if ((chkBrochures.checked == false) && (chkSpecTexts.checked == false) && (chkCadDrawings.checked == true))
                {
                    documentType = chkCadDrawings.value;
                }
                else if ((chkBrochures.checked == false) && (chkSpecTexts.checked == true) && (chkCadDrawings.checked == false))
                {
                    documentType = chkSpecTexts.value;
                } 
                else if ((chkBrochures.checked == true) && (chkSpecTexts.checked == false) && (chkCadDrawings.checked == false))
                {
                    documentType = chkBrochures.value;
                }
       
        DocumentsAtoZ(UrlPrefix,"documents",documentType); 
      return false; 
}

function DocumentsAtoZ(url,pagename,documentType)
{
        document.getElementById("ctl00_hrefComp0to9").href = url + pagename + "/0-9/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompA").href = url + pagename + "/a/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompB").href = url + pagename + "/b/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompC").href = url + pagename + "/c/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompD").href = url + pagename + "/d/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompE").href = url + pagename + "/e/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompF").href = url + pagename + "/f/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompG").href = url + pagename + "/g/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompH").href = url + pagename+ "/h/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompI").href = url + pagename + "/i/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompJ").href = url + pagename + "/j/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompK").href = url + pagename + "/k/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompL").href = url + pagename + "/l/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompM").href = url + pagename+ "/m/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompN").href = url + pagename + "/n/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompO").href = url + pagename + "/o/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompP").href = url + pagename + "/p/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompQ").href = url + pagename + "/q/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompR").href = url + pagename + "/r/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompS").href = url + pagename + "/s/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompT").href = url + pagename + "/t/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompU").href = url + pagename + "/u/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompV").href = url + pagename + "/v/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompW").href = url + pagename + "/w/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompX").href = url + pagename + "/x/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompY").href = url + pagename + "/y/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompZ").href = url + pagename + "/z/"+ documentType +"/1";
        document.getElementById("ctl00_hrefCompViewAll").href = url + pagename + "/all/"+ documentType +"/1";
}


 
 
   
   
   function clearTextEmail()
   {
        document.getElementById("ctl00_ContentPlaceHolder1_txtEmailId").value = "";
   }
   
   function checkchkNoinfo()
        {
            var item = document.getElementById("<%=ChkSendNewsletter.ClientID%>");                        
            if(item.checked==true)
                item.checked=false;
            else
                item.checked=true;
        }
         function checkChkSendNewsletter()
        {
            var item = document.getElementById("<%=chkNoinfo.ClientID%>");                        
            if(item.checked==true)
                item.checked=false;
            else
                item.checked=true;
        }        
        function productDelete(ProductID)
        {      
         var agree=confirm("Are you sure you want to delete the product from archive?");
           if (agree)   
            __doPostBack('productDelete',ProductID);
            else
            return false;
        }
        
        
         function productComparisionStatus(ProductID)
        {          
            __doPostBack('productComparisionStatus',ProductID);
        }
        
    
function ProductComparisionStatus(ProductID)
{  
        var Count = 0;
       var chkbox = document.getElementById(ProductID);
       var ul = document.getElementById('ctl00_ContentPlaceHolder1_divCompareProducts');
        if(ul!=null)
        {
            var theForm = document.forms['aspnetForm'];
            if (!theForm)
            {
                theForm = document.aspnetForm;
            }
            for(var i=0; i<theForm.checkForComparision.length;i++)
            {
                 if(theForm.checkForComparision[i].checked==true)
                 {
                           Count = Count+1;
                 }
                                 
            }
            if((Count >4)||(ul.getElementsByTagName('p').length == 4))
                 {
               
                    if(chkbox.checked == true)
                    {
                        chkbox.checked = false;
                        alert("Only four products can be compared");
                    }
                 }  
              PageMethods._staticInstance = new PageMethods();
                PageMethods._staticInstance._path="/SaveandCompare.aspx";
                PageMethods.ProductComparisionStatus(ProductID,bindCompareProducts); 
           
        }
}

function DeleteComparisionStatus(ProductID)
{
    var chkbox = document.getElementById(ProductID);
    if(chkbox!=null)
    {
        if(chkbox.checked == true)
        {
            chkbox.checked = false;
        }    
    }
    PageMethods._staticInstance = new PageMethods();
    PageMethods._staticInstance._path="/SaveandCompare.aspx";
    PageMethods.ProductComparisionStatus(ProductID,bindCompareProducts);
}

function ProducttoCart(AddCartID)
{
debugger;
  var UserID = AddCartID.split("-");
  if(document.getElementById('ctl00_idsessionuserid') != null)
  {
      var strSessionValue =document.getElementById('ctl00_idsessionuserid').value; 
      if(strSessionValue != "")
      {
        PageMethods._staticInstance = new PageMethods();
        PageMethods._staticInstance._path="/ProductResult.aspx";
        PageMethods.ProducttoCart(AddCartID,AddCartResponse);
      }
      else
      { 
      //newConfirm("ASC Info","Please register to add product to archive??",1,1,0); 
      var where_to=confirm("You need to login for managing the archive products. If you are already registered user then please login or else please register to the ASC. Do you want to register?","","asc info"); 
        if (where_to== true)
         {
           window.location="http://www.ascinfo.co.uk/user-registration";
         }   
       // alert("Please register to add product to archive");
      }  
    }
    else
      { 
      //newConfirm("ASC Info","Please register to add product to archive??",1,1,0); 
      var where_to=confirm("You need to login for managing the archive products. If you are already registered user then please login or else please register to the ASC. Do you want to register?","","asc info"); 
        if (where_to== true)
         {
           window.location="http://www.ascinfo.co.uk/user-registration";
         }   
       // alert("Please register to add product to archive");
      }  
}

function ProductFacttoCart(AddCartID)
{
  var UserID = AddCartID.split("-");
  var strSessionValue =document.getElementById('ctl00_idsessionuserid').value; 
  if(strSessionValue != "")
  {
    PageMethods._staticInstance = new PageMethods();
    PageMethods._staticInstance._path="/ProductResult.aspx";
    PageMethods.ProducttoCart(AddCartID,AddCartResponse);
  }
  else
  { 
  //newConfirm("ASC Info","Please register to add product to archive??",1,1,0); 
  var where_to=confirm("You need to login for managing the archive products. If you are already registered user then please login or else please register to the ASC. Do you want to register?","","asc info"); 
    if (where_to== true)
     {
       window.location="http://www.ascinfo.co.uk/user-registration";
     }   
   // alert("Please register to add product to archive");
  } 
  return false; 
}

function AddCartResponse(response)
{
    if(response != null)
    {
      alert(response);
    }
}

function newConfirm(title,mess,icon,defbut,mods) {
   if (IE4) {
      icon = (icon==0) ? 0 : 2;
      defbut = (defbut==0) ? 0 : 1;
      retVal = makeMsgBox(title,mess,icon,4,defbut,mods);
      retVal = (retVal==6);
   }
   else {
      retVal = confirm(mess);
   }
   return retVal;
}


function bindCompareProducts(response)
{
  var divCompareProducts = document.getElementById("ctl00_ContentPlaceHolder1_divCompareProducts")
   var compareProductsInnerHTML = new String();
   var xmlTGResDoc = null;
   if(response!=null)
    {
        //IE
        if (window.ActiveXObject)
        {
            if(xmlTGResDoc == null)
            {
                  xmlTGResDoc=new ActiveXObject("Microsoft.XMLDOM");
                  xmlTGResDoc.async=false;
                  xmlTGResDoc.loadXML(response);
            } 
        }
        //Mozilla, opera
        else if (document.implementation && document.implementation.createDocument)
        {
           if(xmlTGResDoc == null)
           {
               var parser=new DOMParser();
               xmlTGResDoc=parser.parseFromString(response,"text/xml");
           }
           
        }
        else
        {
          if(xmlTGResDoc == null)
          {
                xmlTGResDoc = document.implementation.createDocument(response,"",null);
          }
        }       
    
       if(xmlTGResDoc.getElementsByTagName("Table1").length >0)
       {
            if(parseInt(xmlTGResDoc.getElementsByTagName("ComparisionProducts")[0].firstChild.nodeValue) == 0)
            { 
                divCompareProducts.innerHTML = "";
                divCompareProducts.className = "none";
            }
            if(parseInt(xmlTGResDoc.getElementsByTagName("ComparisionProducts")[0].firstChild.nodeValue) >0)
            {    
                divCompareProducts.innerHTML = "";  
                divCompareProducts.className = "block";
                compareProductsInnerHTML = compareProductsInnerHTML.concat("<h4>You have currently selected:</h4><div class=\"compare_select_main\">");
                var UrlPath = new Array(); 
                UrlPath = document.getElementById("ctl00_ContentPlaceHolder1_hdnUrlPath").value.split(',');
                
                for(var typeId=(xmlTGResDoc.getElementsByTagName("Table").length);typeId<(xmlTGResDoc.getElementsByTagName("Table1").length+xmlTGResDoc.getElementsByTagName("Table").length);typeId++)
                { 
                    var productName = xmlTGResDoc.getElementsByTagName("Product_Name")[typeId].firstChild.nodeValue;
                    if (productName.trim().length > 30)
                    {
                        productName = productName.substring(0, 30) + "..";
                    }
                   
                    if(xmlTGResDoc.getElementsByTagName("ImageUrl")[typeId] != null)
                    {
                      compareProductsInnerHTML = compareProductsInnerHTML.concat("<div class=\"compare_select_pro\"><p>" + productName + "</p><div class=\"imgdiv\"><img onmouseover=\"javascript:customTooltip('" + xmlTGResDoc.getElementsByTagName("Product_Name")[typeId].firstChild.nodeValue + "');\" onmouseout=\"javascript:customTooltip();\" src=\"" + UrlPath[0] + "GetThumbnail.ashx?filename=" + UrlPath[1] + xmlTGResDoc.getElementsByTagName("ImageUrl")[typeId].firstChild.nodeValue + "&amp;width=80&amp;height=60\" alt=\"\" /></div><input type=\"button\" class=\"button\" onclick=\"javascript:DeleteComparisionStatus(" + xmlTGResDoc.getElementsByTagName("Product_SYS_ID")[typeId].firstChild.nodeValue + ");\" value=\"Remove\" /></div>");
                    }
                    else
                    {
                    compareProductsInnerHTML = compareProductsInnerHTML.concat("<div class=\"compare_select_pro\"><p>" + productName + "</p><div class=\"imgdiv\"><img onmouseover=\"javascript:customTooltip('" + xmlTGResDoc.getElementsByTagName("Product_Name")[typeId].firstChild.nodeValue + "');\" onmouseout=\"javascript:customTooltip();\" src=\"/Images/spacer.gif\" width=\"80\" height=\"60\" alt=\"\" /></div><input type=\"button\" class=\"button\" onclick=\"javascript:DeleteComparisionStatus(" + xmlTGResDoc.getElementsByTagName("Product_SYS_ID")[typeId].firstChild.nodeValue + ");\" value=\"Remove\" /></div>");
                    }
                }
               compareProductsInnerHTML = compareProductsInnerHTML.concat("<div class=\"compare_bt\"><a class=\"compareButton\" href=\"/compareproducts/"+UrlPath[2]+"\"></a></div></div>");
               divCompareProducts.innerHTML = compareProductsInnerHTML;
           }
       } 
       else
       {
            divCompareProducts.innerHTML = "";           
       }
   }
}
// these functions are for  by satya
var min=11;
var max=16;
function increaseFontSize() {
   var body = document.getElementsByTagName('p');
   for(i=0;i<body.length;i++) {
      if(body[i].style.fontSize) {
         var s = parseInt(body[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      body[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var body = document.getElementsByTagName('p');
   for(i=0;i<body.length;i++) {
      if(body[i].style.fontSize) {
         var s = parseInt(body[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      body[i].style.fontSize = s+"px"
   }   
}

function mailpage()
{
mail_str = "mailto:?subject=" + document.title;
mail_str += "&body=I thought you might be interested in the " + document.title;
mail_str += ". You can view it at, " + location.href.toString();
location.href = mail_str;
}


function AddToFavorite()
{
  title = document.title;
    url = location.href.toString();
    if (window.sidebar) 
    {// Mozilla
    window.sidebar.addPanel(title, url,"");
    } 
    else if( window.external ) 
    {// IE Favorite
    window.external.AddFavorite( url, title);
    }
    else if(window.opera && window.print) 
    {// Opera
    return true;
    }
}




   var ControlID
    function popupshow(inp)
    {   
//         ControlID=inp;
//         window.open("PrintPreview.aspx?id=pp","","menubar=0,status=0,height=700,width=1000,scrollbars=1");

//        if(document.getElementById('ctl00_ContentPlaceHolder1_divProdDownloads'))
//        {
//        document.getElementById('ctl00_ContentPlaceHolder1_divProdDownloads').style.display = 'block';
//        }
//        if(document.getElementById('divRelatedCategories'))
//        {
//        document.getElementById('divRelatedCategories').style.display = 'block';
//        }
//        if(document.getElementById('divProdBrouchures'))
//        {
//        document.getElementById('divProdBrouchures').style.display = 'block';
//        }
//        if(document.getElementById('divProdSpech'))
//        {
//        document.getElementById('divProdSpech').style.display = 'block';
//        }
//        if(document.getElementById('divProdCAD'))
//        {
//        document.getElementById('divProdCAD').style.display = 'block';
//        }
//        //for company factfil
//        if(document.getElementById('ctl00_ContentPlaceHolder1_divDownloads'))
//        {
//        document.getElementById('ctl00_ContentPlaceHolder1_divDownloads').style.display = 'block';
//        }
//        if(document.getElementById('divProductImages'))
//        {
//        document.getElementById('divProductImages').style.display = 'block';
//        }
//        if(document.getElementById('divdetailsofCompany'))
//        {
//        document.getElementById('divdetailsofCompany').style.display = 'block';
//        }
//        if(document.getElementById('divNewsandprojects'))
//        {
//        document.getElementById('divNewsandprojects').style.display = 'block';
//        }
//        if(document.getElementById('divCategories'))
//        {
//        document.getElementById('divCategories').style.display = 'block';
//        }
//        //end of company factfile
       document.getElementById('divPagetools').style.visibility='hidden';
        var DocumentContainer = document.getElementById('divmain');
        var WindowObject = window.open("", "PrintWindow",
        "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes,background=none");
        WindowObject.document.writeln("  <link href='/CSS/pagePrint.css' rel='stylesheet' type='text/css' />"+DocumentContainer.innerHTML);
        WindowObject.document.close();
        WindowObject.focus();
        WindowObject.print();
        WindowObject.close(); 
        document.getElementById('divPagetools').style.visibility='visible';       
        //end of company factfile
       
    }
    
    
 function CatchEvent(CompanyID,Content,TypName)
{
//    alert('xxxxxx');
    PageMethods._staticInstance = new PageMethods();
    PageMethods._staticInstance._path="/Companyfactfile.aspx";
    PageMethods.CatchEvent(CompanyID,Content,TypName);
}

// function CatchEventProduct(ProductID)
//{
//    PageMethods._staticInstance = new PageMethods();
//    PageMethods._staticInstance._path="/ProductFactfile.aspx";
//    PageMethods.CatchEventProduct(ProductID);
//}

function PdfthisFile()
{
 var DocumentContainer = document.getElementById('divmain');
 __doPostBack('Pdfdowload',"<link href='/CSS/pageStyle.css' rel='stylesheet' type='text/css' />"+DocumentContainer.innerHTML);
}



function browseNews()
{
    var ddlMonth = document.getElementById('ctl00_ContentPlaceHolder1_ddlMonth');
    var ddlyear = document.getElementById('ctl00_ContentPlaceHolder1_ddlyear');
    var txtKeyword = document.getElementById('ctl00_ContentPlaceHolder1_txtKeyword');
    var lnkBrowse = document.getElementById('ctl00_ContentPlaceHolder1_lnkBrowse');
    var Year = ddlyear(ddlyear.selectedIndex).value;
    var Month = ddlMonth(ddlMonth.selectedIndex).value; 
}

 function validateLogin()
        {
            var username= document.getElementById('ctl00_txtUserName').value;
            var password= document.getElementById('ctl00_txtPassword').value;
            if(username.length==0 && password.length==0)            
            {   
                document.getElementById('ctl00_divError').innerHTML = "Enter Username and Password";                
                return false;       
            }
            else
            {
                if(username.length==0)            
                {                   
                    document.getElementById('ctl00_divError').innerHTML = "Enter Username";
                    return false;       
                }
                else
                {
                    if(password.length==0)            
                    {                   
                        document.getElementById('ctl00_divError').innerHTML = "Enter Password";
                        return false;       
                    }
                    else
                    {
                        return true;
                    }                    
                }                
            }         
               
        }
        
        function validateForgetPassword()
        {
            
            var username= document.getElementById('ctl00_txtUserName').value;
            if(username.length==0)            
            {                   
                document.getElementById('ctl00_divError').innerHTML = "Enter Username";
                return false;       
            }
            else
            {                
                    return true;                                  
            }                
           
        }
        function ValidateNewsletterEmail()
        {       
            var falsCount=0; 
            var isValidated = true;     
            if(validate_requiredtxtUserName()!= true )
            {                
                falsCount=falsCount+1;
            }        
            if(validate_requiredNewsletterEmail()!= true )
            {                
                falsCount=falsCount+1;
            }
            if(falsCount>0)
            {
                isValidated = false;
            }
            return isValidated;
        }
        //validatenewsletter
        
        function validatenewsletter()
        {
        
            var falsCount=0; 
            var isValidated = true; 
            if(validate_requiredtxtUserName()!= true )
            {                
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtEmail()!= true )
            {                
                falsCount=falsCount+1;
            }
            if(falsCount>0)
            {
                isValidated = false;
            }
            return isValidated;
        }
        
        
        //validateChangePassword
        function validateChangePassword()
        {
            var falsCount=0; 
            var isValidated = true; 
            if(validate_requiredtxtLoginName()!= true )
            {                
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtPassword()!= true )
            {            
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtCnfPassword()!= true )
            {           
                falsCount=falsCount+1;
            } 
            if(validate_requiredtxtOldPassword()!= true )
            {           
                falsCount=falsCount+1;
            } 
            if(falsCount>0)
            {
                isValidated = false;
            }
            return isValidated;
        }
        // uger registration
        function validateChangeRegistration()
        {      
         var falsCount=0; 
         var isValidated = true; 
            if(validate_requiredddlTitle()!= true )
            {            
                falsCount=falsCount+1;
            }
            if(validate_requiredddlUserType()!= true )
            {            
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtForeName()!= true)
            {
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtSurName()!= true)
            {                
                falsCount=falsCount+1;
            }
            if( validate_requiredtxtEmail()!= true)
            {
                falsCount=falsCount+1;
            }
             if(validate_requiredtxtCity()!= true)
             {                
                falsCount=falsCount+1;
            }           
            if(validate_requiredtxtVerify()!= true)
            {
               falsCount=falsCount+1;
            }  
            if(validate_requiredddlCountry()!= true )
            {
               falsCount=falsCount+1;
            } 
            if(falsCount>0)
            {
                isValidated = false;
            }
            return isValidated;
         }
           // for add company
        function AddCompany()
        {        
          var falsCount=0;
          var isValidated = true;
            if(validate_requiredtxtAddress()!= true)
            {
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtPostalCode()!= true)
            { 
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtCompanyName()!= true)
            {
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtPhone()!= true)
            {
                 falsCount=falsCount+1;
            }
            if(validate_requiredtxtFax()!= true)
            {
                 falsCount=falsCount+1;
            }
            if(validate_requiredtxtWebsite()!= true)
            {
                 falsCount=falsCount+1;                
            }
            if(validate_requiredddlCompanyType()!= true)
            {
                 falsCount=falsCount+1;
            }
            if(validate_requiredddlCategory()!= true)
            {
                 falsCount=falsCount+1;
            }
             if(validate_requiredtxtComments()!= true)
            {
                 falsCount=falsCount+1;
            }
            if(validate_requiredddlTitle()!= true )
            {
             falsCount=falsCount+1;
            }
            if(validate_requiredddlCountry()!= true )
            {
             falsCount=falsCount+1;              
            }
            if(validate_requiredtxtFullName()!= true)
            {
                 falsCount=falsCount+1;
            }
            if( validate_requiredtxtEmail()!= true)
            {
                 falsCount=falsCount+1;
            }
             if(validate_requiredtxtCity()!= true)
             {
                 falsCount=falsCount+1;
            }    
            if(validate_requiredtxtVerify()!= true)
            {
                 falsCount=falsCount+1;               
            }   
            if(falsCount>0)
            {
                isValidated = false;
            } 
            return isValidated;
        }
         function validateUserRegistration()
        {      
              var falsCount=0; 
            var isValidated = true; 
            if(validate_requiredtxtLoginName()!= true )
            {                
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtPassword()!= true )
            {            
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtCnfPassword()!= true )
            {           
                falsCount=falsCount+1;
            } 
            if(validate_requiredddlTitle()!= true )
            {           
                falsCount=falsCount+1;
            }
            if(validate_requiredddlUserType()!= true )
            {            
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtForeName()!= true)
            {                
                falsCount=falsCount+1;
            }
            if(validate_requiredtxtSurName()!= true)
            {               
                falsCount=falsCount+1;
            }
            if( validate_requiredtxtEmail()!= true)
            {                
                falsCount=falsCount+1;
            }
             if(validate_requiredtxtCity()!= true)
             {               
                falsCount=falsCount+1;
            }           
            if(validate_requiredtxtVerify()!= true)
            {                
                falsCount=falsCount+1;
            }  
            if(validate_requiredddlCountry()!= true )
            {               
                falsCount=falsCount+1;
            } 
            if(falsCount>0)
            {
                isValidated = false;
            }
            return isValidated;
         }
//           // for add company
//        function AddCompany()
//        {        
//          var isValidated = false;
//            if(validate_requiredtxtAddress()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtPostalCode()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtCompanyName()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtPhone()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtFax()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtWebsite()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredddlCompanyType()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredddlCategory()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//             if(validate_requiredtxtComments()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredddlTitle()== true )
//            {
//            isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredddlCountry()== true )
//            {
//            isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if(validate_requiredtxtFullName()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//            if( validate_requiredtxtEmail()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }
//             if(validate_requiredtxtCity()== true)
//             {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }    
//            if(validate_requiredtxtVerify()== true)
//            {
//                isValidated = true;
//            }
//            else
//            {
//                isValidated = false;
//            }    
//            return isValidated;
//        }
        
   //for validation SEO point of view     
    function allValidations()
    {     
     var falsCount=0;    
    var isValidated = true;    
    if(validate_requiredtxtCompanyType()!= true )
    {
     falsCount=falsCount+1;
    }
    
    if(validate_requiredtxtFullName()!= true)
    {
         falsCount=falsCount+1;
    }
    if( validate_requiredtxtEmail()!= true)
    {
        falsCount=falsCount+1;
    }
    
    if(validate_requiredtxtEnquiry()!= true)
    {
        falsCount=falsCount+1;
    }
    if(validate_requiredtxtVerify()!= true)
    {
         falsCount=falsCount+1;
    }  
    if(falsCount>0)
    {
        isValidated = false;
    }    
    return isValidated;
}

function allResultValidations()
    { 
     var falsCount=0;    
    var isValidated = true;    
    if(validate_requiredtxtCompanyType()!= true )
    {
     falsCount=falsCount+1;
    }
   
    if(validate_requiredtxtFullName()!= true)
    {
         falsCount=falsCount+1;
    }
    if( validate_requiredtxtEmail()!= true)
    {
        falsCount=falsCount+1;
    }
    
    if(validate_requiredtxtEnquiry()!= true)
    {
        falsCount=falsCount+1;
    }
    if(validate_requiredtxtVerify()!= true)
    {
         falsCount=falsCount+1;
    }  
    if(falsCount>0)
    {
        isValidated = false;
    }
    if(isValidated == true)
    {
        var c_value = "";
        var S_value="";
        var theForm = document.forms['aspnetForm'];
            if (!theForm)
            {
                theForm = document.aspnetForm;
            }
         if(theForm.music != null)
         {
            for (var i=0; i < theForm.music.length; i++)
            {            
                if (theForm.music[i].checked)
                {  
                   var selectedIds=   theForm.music[i].id.substring(3,theForm.music[i].id.length);
                    c_value = c_value + selectedIds+",";              
                }
            }
        }
        if((theForm.music != null)&&(c_value ==""))
        {
            if (theForm.music.checked)
            {  
               var selectedIds=   theForm.music.id.substring(3,theForm.music.id.length);
                c_value = c_value + selectedIds+",";              
            }
        } 
         if(theForm.standard != null)
         {
            for (var i=0; i < theForm.standard.length; i++)
            {            
                if (theForm.standard[i].checked)
                {  
                   var selectedIds=   theForm.standard[i].id.substring(3,theForm.standard[i].id.length);
                    S_value = S_value + selectedIds+",";              
                }
            }
        }
        if((theForm.standard != null)&&(c_value ==""))
        {
            if (theForm.standard.checked)
            {  
               var selectedIds=   theForm.standard.id.substring(3,theForm.standard.id.length);
                S_value = S_value + selectedIds+",";              
            }
        }          
            
        if(c_value=="" && S_value=="")
        {
          alert("Please select atleast one item");
          isValidated=false;
        }
        else
        {
            document.getElementById("ctl00_ContentPlaceHolder1_hdnCompIds").value= c_value+S_value;      
        }
    }  
    return isValidated;
}
   function allFactFilesValidations()
    {       
     var falsCount=0;    
    var isValidated = true;    
     if(validate_requiredtxtCompanyType()!= true )
    {
     falsCount=falsCount+1;
    }
    if(validate_requiredtxtFullName()!= true)
    {
         falsCount=falsCount+1;
    }
    if( validate_requiredtxtEmail()!= true)
    {
        falsCount=falsCount+1;
    }
   
    if(validate_requiredtxtEnquiry()!= true)
    {
        falsCount=falsCount+1;
    }
    if(validate_requiredtxtVerify()!= true)
    {
         falsCount=falsCount+1;
    }  
    if(falsCount>0)
    {
        isValidated = false;
    }
    if(isValidated == true)
    {
        var c_value = "";
        var theForm = document.forms['aspnetForm'];
            if (!theForm)
            {
                theForm = document.aspnetForm;
            }
        for (var i=0; i < theForm.music.length; i++)
        {            
            if (theForm.music[i].checked)
            {  
               var selectedIds=   theForm.music[i].id.substring(3,theForm.music[i].id.length);
                c_value = c_value + selectedIds+",";              
            }
        }   
        if((theForm.music != null)&&(c_value ==""))
        {
            if (theForm.music.checked)
            {  
               var selectedIds=   theForm.music.id.substring(3,theForm.music.id.length);
                c_value = c_value + selectedIds+",";              
            }
        }     
        document.getElementById("ctl00_ContentPlaceHolder1_hdnCompIds").value= c_value;    
        
    }  
    return isValidated;
}

function validate_requiredtxtUserName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtUserName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtUserName'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtUserName'))                       
             return true;
          }
    }
}
function validate_requiredtxtLoginName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtLoginName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtLoginName'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtLoginName'))                       
             return true;
          }
    }
}
function validate_requiredtxtPassword()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtPassword'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPassword'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPassword'))                       
             return true;
          }
    }
}
function validate_requiredtxtCnfPassword()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtCnfPassword'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCnfPassword'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCnfPassword'))                       
             return true;
          }
    }
}

function validate_requiredtxtOldPassword()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtOldPassword'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtOldPassword'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtOldPassword'))                       
             return true;
          }
    }
}

function validate_requiredtxtForeName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtForeName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtForeName'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtForeName'))                       
             return true;
          }
    }
}

function validate_requiredtxtSurName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtSurName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtSurName'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtSurName'))                       
             return true;
          }
    }
}

function validate_requiredddlUserType()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_ddlUserType'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
          creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlUserType'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlUserType'))                 
             return true;
          }
    }
}

function validate_requiredddlTitle()
{
    with(document.getElementById('ctl00_ContentPlaceHolder1_ddlTitle'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
          creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlTitle'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlTitle'))                 
             return true;
          }
    }
}
function validate_requiredddlCountry()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_ddlCountry'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCountry'))
           return false;
          }
          else
          {  
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCountry'))                      
             return true;
          }
    }
}

function validate_requiredtxtFullName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtFullName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtFullName'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtFullName'))                       
             return true;
          }
    }
}

function validate_requiredtxtCompanyType()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_ddlCmpType'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCmpType'))
           return false;
          }
          else
          { 
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCmpType'))                       
             return true;
          }
    }
}

function validate_requiredNewsletterEmail()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtEmailId'))
    {
          if (value==null||value==""||value=="Enter Email")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmailId'))
           return false;
          }
          else
          { 
           var emailExpression  = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;            
            var element = document.getElementById('ctl00_ContentPlaceHolder1_txtEmailId');
            if(emailExpression.test(element.value))
            {
               collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmailId'))   
                return true;
            }
            else
            {
               createEmaildiv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmailId'))
               return false;
            }  
//           collapsediv(document.getElementById('ctl00$ContentPlaceHolder1$txtEmailId'))   
//             return true;
          }
    }
}

function validate_requiredtxtEmail()
{

    with (document.getElementById('ctl00_ContentPlaceHolder1_txtEmail'))
    {
          if (value==null||value==""||value=="Enter Email")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmail'))
           return false;
          }
          else
          { 
            var emailExpression  = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
            
            var element = document.getElementById('ctl00_ContentPlaceHolder1_txtEmail');
            if(emailExpression.test(element.value))
            {
               collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmail'))   
                return true;
            }
            else
            {
               createEmaildiv(document.getElementById('ctl00_ContentPlaceHolder1_txtEmail'))
               return false;
            }
 
        
          }
    }
}
function validate_requiredtxtCity()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtCity'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCity'))
           return false;
          }
          else
          {  
           collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCity'))                  
             return true;
          }
    }
}
//Request/enquery validation (SEO point of view) 
function validate_requiredtxtEnquiry()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtEnquiry'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEnquiry'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtEnquiry'))       
             return true;
          }
    }
}
//capcha code validation (SEO point of view) 
function validate_requiredtxtVerify()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtVerify'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtVerify'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtVerify'))       
             return true;
          }
    }
}


function validate_requiredtxtAddress()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtAddress'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtAddress'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtAddress'))       
             return true;
          }
    }
}
function validate_requiredtxtPostalCode()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtPostalCode'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPostalCode'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPostalCode'))       
             return true;
          }
    }
}
function validate_requiredtxtCompanyName()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtCompanyName'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCompanyName'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtCompanyName'))       
             return true;
          }
    }
}
function validate_requiredtxtPhone()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtPhone'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPhone'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtPhone'))       
             return true;
          }
    }
}
function validate_requiredtxtFax()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtFax'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtFax'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtFax'))       
             return true;
          }
    }
}
function validate_requiredtxtWebsite()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtWebsite'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtWebsite'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtWebsite'))       
             return true;
          }
    }
}
function validate_requiredddlCompanyType()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_ddlCompanyType'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCompanyType'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCompanyType'))       
             return true;
          }
    }
}
function validate_requiredddlCategory()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_ddlCategory'))
    {
          if (value==null||value==""||value=="--Select--"||value=="Select")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCategory'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_ddlCategory'))       
             return true;
          }
    }
}
function validate_requiredtxtComments()
{
    with (document.getElementById('ctl00_ContentPlaceHolder1_txtComments'))
    {
          if (value==null||value=="")
          {
           creatediv(document.getElementById('ctl00_ContentPlaceHolder1_txtComments'))
           return false;
          }
          else
          {   
            collapsediv(document.getElementById('ctl00_ContentPlaceHolder1_txtComments'))       
             return true;
          }
    }
}
//create error div for  validation (SEO point of view) 
function creatediv(elementID)
{

    var errorSpanId = elementID.id + "_errorSpan"    
    var errorSpan = document.getElementById(errorSpanId);    
    if(errorSpan !=null)
    {
        elementID.parentNode.removeChild(errorSpan);
    } 
        errorSpan = document.createElement('div');
        errorSpan.id = errorSpanId;     
        if( elementID.attributes["title"])
        {
            errorSpan.innerHTML = elementID.attributes["title"].value;
        }
        else
        {
            errorSpan.innerHTML =  "Enter Value";    
        }       
        errorSpan.className = 'error_field';
        errorSpan.style.textAlign = 'left';
        errorSpan.style.zIndex = elementID.style.zIndex + 1;
        elementID.parentNode.insertBefore( errorSpan, elementID.nextSibling); 
 
    errorSpan.style.display = 'block';
}

//collapse error div for  validation (SEO point of view) 
function collapsediv(elementID)
{
    var errorSpanId = elementID.id + "_errorSpan"
    var errorSpan = document.getElementById(errorSpanId);
    if(errorSpan!=null)
    {
            errorSpan.style.display = 'none';
    }
};
//End of validation SEO point of view 
function createEmaildiv(elementID)
{
    var errorSpanId = elementID.id + "_errorSpan"    
    var errorSpan = document.getElementById(errorSpanId);    
    if(errorSpan !=null)
    {
        elementID.parentNode.removeChild(errorSpan);
    } 
        errorSpan = document.createElement('div');
        errorSpan.id = errorSpanId;     
//        if( elementID.attributes["title"])
//        {
//            errorSpan.innerHTML = elementID.attributes["title"].value;
//        }
//        else
//        {
            errorSpan.innerHTML =  "Enter Valid Email";    
      //  }       
        errorSpan.className = 'error_field';
        errorSpan.style.textAlign = 'left';
        errorSpan.style.zIndex = elementID.style.zIndex + 1;
        elementID.parentNode.insertBefore( errorSpan, elementID.nextSibling); 
 
    errorSpan.style.display = 'block';
}
//below functions for premium companies
function SelectedCompanies(type)
{

    var count =0;
    var allcount=0;
   var divSelectedResults = document.getElementById("divSelectedResults");
   divSelectedResults.className ="selectedListBasket";
    var selectedCompaniesInnerHTML = new String();
    var theForm = document.forms['aspnetForm'];
    if (!theForm)
    {
    theForm = document.aspnetForm;
    }
    divSelectedResults.innerHTML=""; 
    if(type=="C")
    {   
    selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<div class=\"clear\"></div><div class=\"result_header\"><h3>Selected Companies</h3><hr/></div><div class=\"clear\"></div><div class=\"selectedItemList\"><ul>");
    }
    else if(type=="P" || type=="CF")
    {
    selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<div class=\"clear\"></div><div class=\"result_header\"><h3>Selected Products</h3><hr/></div><div class=\"clear\"></div><div class=\"selectedItemList\"><ul>");
    }
    else
    {
    selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<div class=\"clear\"></div><div class=\"result_header\"><h3>Selected News</h3><hr/></div><div class=\"clear\"></div><div class=\"selectedItemList\"><ul>");
    }
    for (var i=0; i < theForm.music.length; i++)
    {     
        allcount=allcount+1;       
        if (theForm.music[i].checked)
        { 
         var selectedIds=   theForm.music[i].id.substring(3,theForm.music[i].id.length);
           var CompanyName = document.getElementById("lnk"+selectedIds).innerHTML;
           if(type=="P")
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li class=\"largeContent\"><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music[i].id+"','"+type+"');\" class=\"hand\" />"+CompanyName +" - "+ theForm.music[i].value+"</li>");              
           }
           else if(type=="N")
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music[i].id+"','"+type+"');\" class=\"hand\" />"+theForm.music[i].value+"</li>");              
           }
           else
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music[i].id+"','"+type+"');\" class=\"hand\" />"+CompanyName+"</li>");              
           }
           count = count+1;
        }
    }
    if(count != allcount)
    {
     document.getElementById("chkprecompany").checked=false;
     if(document.getElementById("chkbottomselectall") != null)
     {
     document.getElementById("chkbottomselectall").checked=false;
     }
    }
    else
    {
    document.getElementById("chkprecompany").checked=true;
    if(document.getElementById("chkbottomselectall") != null)
     {
     document.getElementById("chkbottomselectall").checked=true;
     }
    }  
    if((theForm.music != null)&&(count ==0))
    {
        if (theForm.music.checked)
        { 
         var selectedIds=   theForm.music.id.substring(3,theForm.music.id.length);
           var CompanyName = document.getElementById("lnk"+selectedIds).innerHTML;
           if(type=="P")
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li class=\"largeContent\"><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music.id+"','"+type+"');\" class=\"hand\" />"+CompanyName +" - "+ theForm.music.value+"</li>");              
           }
           else if(type=="N")
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music.id+"','"+type+"');\" class=\"hand\" />"+theForm.music.value+"</li>");              
           }
           else
           {
           selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("<li><img src=\"/Images/deletedSelectedItem.gif\" alt=\"\" onclick=\"javascript:UnselectSelectedCompany('"+theForm.music.id+"','"+type+"');\" class=\"hand\" />"+CompanyName+"</li>");              
           }
           count = count+1;
           document.getElementById("chkprecompany").checked=true;
            if(document.getElementById("chkbottomselectall") != null)
            {
             document.getElementById("chkbottomselectall").checked=true;
             }
        }
        else
        {
            document.getElementById("chkprecompany").checked=false;
            if(document.getElementById("chkbottomselectall") != null)
            {
             document.getElementById("chkbottomselectall").checked=false;
             }
        }
       
    }
    selectedCompaniesInnerHTML = selectedCompaniesInnerHTML.concat("</ul><div class=\"clear\"></div></div>");
    divSelectedResults.innerHTML = selectedCompaniesInnerHTML;
    if(count ==0)
    {
        divSelectedResults.className ="none";
         document.getElementById("chkprecompany").checked=false;
         if(document.getElementById("chkbottomselectall") != null)
            {
             document.getElementById("chkbottomselectall").checked=false;
             }
    }
}

function UnselectSelectedCompany(CompanyID,type)
{
    var chkUncheck = document.getElementById(CompanyID);
    chkUncheck.checked = false;
    document.getElementById("chkprecompany").checked=false;
     if(document.getElementById("chkbottomselectall") != null)
            {
             document.getElementById("chkbottomselectall").checked=false;
             }
    SelectedCompanies(type);
}

function OnCompanySubmit(CompanyIDs,type)
{
     var CompanyID = CompanyIDs.split(",");
    for (var i=0; i < CompanyID.length-1; i++)
    {            
       var chk = document.getElementById("chk"+CompanyID[i]);
       chk.checked = true;
    } 
    var  count=0; 
    if(theForm.music!=null)
   {  
       for (var i=0; i < theForm.music.length; i++)
        {            
         count=count+1;
        }
    }
    if((theForm.music != null)&&(count ==0))
    {
        if (theForm.music.checked)
        { 
         count=count+1;
        }
     }
     if(count !=0)
    {
        SelectedCompanies(type);
    }
}


function download(Path)
{   
    PageMethods._staticInstance = new PageMethods();
    PageMethods._staticInstance._path="/ProductFactfile.aspx";
    PageMethods.download(Path);
}

function selectAllForEnquery(type)
{

        var all_value=""; 
        var count =0;      
        for (var i=0; i < theForm.allselect.length; i++)
        { 
            if (theForm.allselect.checked)
            { 
                all_value=all_value+1;
            }
        }
        
        if((theForm.allselect != null)&&(all_value ==""))
        {
            if (theForm.allselect.checked)
            {  
                for (var i=0; i < theForm.music.length; i++)
                {            
                   theForm.music[i].checked=true;
                   count = count+1;
                }  
                 if((theForm.music != null)&&(count ==0))
                 {
                    theForm.music.checked = true;
                 }          
            }
            else
            {
                for (var i=0; i < theForm.music.length; i++)
                {            
                   theForm.music[i].checked=false;
                    count = count+1;
                } 
                if((theForm.music != null)&&(count ==0))
                 {
                    theForm.music.checked = false;
                 }
            }
        } 
        SelectedCompanies(type);
}

function BottomselectAllForEnquery(type)
{
        var Bottom_value="";     
         var count =0;        
        for (var i=0; i < theForm.bottomall.length; i++)
        { 
            if (theForm.bottomall.checked)
            { 
                Bottom_value=Bottom_value+1;
            }
        }
        
        if((theForm.bottomall != null)&&(Bottom_value ==""))
        {
            if (theForm.bottomall.checked)
            {  
                for (var i=0; i < theForm.music.length; i++)
                {            
                   theForm.music[i].checked=true;
                   count = count+1;
                }   
                if((theForm.music != null)&&(count ==0))
                 {
                    theForm.music.checked = true;
                 }          
            }
            else
            {
                for (var i=0; i < theForm.music.length; i++)
                {            
                   theForm.music[i].checked=false;
                   count = count+1;
                } 
                if((theForm.music != null)&&(count ==0))
                 {
                    theForm.music.checked = false;
                 }
            }
        }     
        SelectedCompanies(type);
}



function FillSearchContent(compkey)
{

    PageMethods._staticInstance = new PageMethods();
    PageMethods._staticInstance._path="/Home.aspx";
    PageMethods.FillSearchContent(compkey,createAutoComplete,onFailed);
   
}
function onFailed(err)
    {   
      alert('error');
    }
    
function TopTextAssaign()
{
  document.getElementById('ctl00_ContentPlaceHolder1_txtBtmTextAssaign').value=document.getElementById('ctl00_ContentPlaceHolder1_txtTpSearch').value;
}
function BottomTextAssaign()
{
  document.getElementById('ctl00_ContentPlaceHolder1_txtTpSearch').value=document.getElementById('ctl00_ContentPlaceHolder1_txtBtmTextAssaign').value;
}

function SaveandCompare()
{ 
  var where_to=confirm("You need to login for using this feature. If you are already registered user then please login or please register to the ASC site now, do you want to register?","","asc info"); 
    if (where_to== true)
     {
       window.location="http://www.ascinfo.co.uk/user-registration";
     }     
}  

  function OA_adjs(z)
  {
 
   document.MAX_ct0 ='INSERT_CLICKURL_HERE';

   var m3_u = (location.protocol=='https:'?'https://www.vertadnet.com/display/www/delivery/ajs.php':'http://www.vertadnet.com/display/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<script type='text/javascript' src='"+m3_u);
   document.write ("?zoneid="+ z);
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
       document.write ("&amp;ct0=" + escape(document.MAX_ct0));
   }
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/script>");
   }
   
   
//   
//   function enableSearchtext()
//   {
//    document.getElementById('ctl00_txtKeyword').enabled="enabled";
//   }

function CheckKeyword(Name)
{
    var txt = document.getElementById("ctl00_ContentPlaceHolder1_"+Name);      
     if (txt.value.match(/[^a-zA-Z0-9@,;!$()-_=`~ ]/g)) 
     {
        txt.value = txt.value.replace(/[^a-zA-Z0-9@,;!$()-_=`~ ]/g,'');
    }    
}


//function Check()
//{
//var charCode=event.keyCode;

//if ((charCode >=97 && charCode <=122) || (charCode==45) || (charCode >= 48 && charCode <= 57))
//{
//return true;
//}
//else
//{

//return false;
//alert(charCode);
//}
//}