﻿// JScript File
//used to set language of the site as ENGLISH

function setLanguageEng()
{
 document.cookie = "cname=1" + "; expires=31 Dec 2006 23:59:59 GMT;path=/";
}
//used to set language of the site as SPANISH
function setLanguageSpn()
{
  document.cookie = "cname=2" + "; expires=31 Dec 2006 23:59:59 GMT;path=/";
}
function setprevpage()
{
 document.cookie = "previouspage=2" + "; expires=31 Dec 2006 23:59:59 GMT;";
}

//used to open page to show full size of an image

function showFullSize(path,root)
            {
                window.open(root+"ui/fullsizeimg.aspx?path="+path,"LargeSize","width=400,height=400,left=150,top=5,scrollbars=Yes resizable=no");
                return false;
            }   
            
         
//used to add url in favourites 
            
  function AddtoFav()
            {
           var url=window.location.href
           var title='spectrum cosmetic'
            if (window.sidebar) { 
            window.sidebar.addPanel(title, url,""); 
            } else if( document.all ) {
            window.external.AddFavorite( url, title);
            } else if( window.opera && window.print ) {
            }
            return false;

            }
            
  //used to do enter for buttons 
  
    function doEnter(btnid)
            {
                
             var btn = document.getElementById(btnid); 
                                
                
           if(window.Event)
            {
            window.captureEvents(Event.KEYPRESS)
            }
           
            document.onkeypress=  keyPressed;
            function keyPressed(e)
             {
                 var n
                (window.Event) ? n=e.which : n=event.keyCode
              
                 if (n==13)
                 {
                 btn.click(); 
                 return false;
                 }
             }
             }
             
     //open page for currency converter        
 function currency()
{
 
window.open('http://www.oanda.com/convert/classic?user=synertech','currencyconvertor','height=550,width=550');
}

//open page for size convertion

function sizeconverter()
{
 
window.open('../sizeconverter.htm','sizeconvertor','height=150,width=350');
}



//it saves date of birth value in hidden field

function showDOB_UserReg()
{
 document.getElementById('ctl00_ContentPlaceHolder1_HiddenField1').value=document.getElementById('ctl00_ContentPlaceHolder1_txtDoB').value;
 return true;
}



//it saves State value in hidden field

function saveStateValue_UserReg()
{

  document.getElementById("ctl00_ContentPlaceHolder1_Hiddenshpstate").value=document.getElementById("ctl00_ContentPlaceHolder1_drpshpstate").options[document.getElementById("ctl00_ContentPlaceHolder1_drpshpstate").selectedIndex].value;


return true;
}

//used for printing a window

function printIt()
{      
    document.getElementById('btnPrint').style.visibility='hidden';
    document.getElementById('btnClose').style.visibility='hidden';
      window.print();
         window.self.location.reload();
    
  }

//opens window to show HTML and contains print it feature 

function PrintBill(name)
{

    var wnd=window.open("PrintReceipt.aspx","Bill","height=700, width=700, scrollbars=yes");
    wnd.document.write("<html><head>");  
    wnd.document.write("<link href='../styles/style.css' rel='stylesheet' type='text/css'>");  
    wnd.document.write("<script type='text/javascript' src='../JavaScript/commonfunctions.js'> ");
    wnd.document.write('</script></head><body>');   
    wnd.document.write("<p class='pinktext' align='center'>" + name + "</p>");
  //  wnd.document.write(document.getElementById("Divorderdetails").innerHTML+"<BR>");
   wnd.document.write("<p align='center' ><input id='btnPrint' onclick='printIt();' type=button value='Print' />&nbsp;&nbsp;&nbsp;<input id='btnClose' onclick='window.close();' type=button value='Close' /></p>");
    wnd.document.write(document.getElementById("ctl00_ContentPlaceHolder1_panelreceipt").innerHTML+"<BR>");
   
    wnd.document.write("</body></html>");     
    wnd.document.close();   
    return false;    

}



function PrintDBill(name)
{
    var wnd=window.open("PrintReceipt.aspx","Bill","height=700, width=700, scrollbars=yes");
    wnd.document.write("<html><head>");  
    wnd.document.write("<link href='../styles/style.css' rel='stylesheet' type='text/css'>");  
   wnd.document.write("<script type='text/javascript'> ");
    wnd.document.write("function printIt() ");
     wnd.document.write("{  document.getElementById('btnPrint').style.visibility='hidden'; ");
     wnd.document.write("document.getElementById('btnClose').style.visibility='hidden';");
       wnd.document.write("window.print(); ");
        wnd.document.write(" window.self.location.reload(); }");
    wnd.document.write("</script></head><body>");   
    wnd.document.write("<p class='pinktext' align='center'>" + name + "</p><BR><BR>");
    wnd.document.write(document.getElementById("ctl00_ContentPlaceHolder1_pnlstepthree").innerHTML+"<BR>");
    wnd.document.write("<p align='center'><input id='btnPrint' onclick='printIt();' type=button value='Print' />&nbsp;&nbsp;&nbsp;<input id='btnClose' onclick='window.close();' type=button value='Close' /></p>");
   wnd.document.write("</body></html>");     
    wnd.document.close();   
    return false;    

}
