
//code to open page as popup

//dFeatures = 'dialogHeight: 450px; dialogWidth: 1049px; dialogTop: 646px; dialogLeft: 4px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;';//default features 
dFeatures =fnSetValues();
modalWin = ""; 
function ShowPopup( sURL) 
    { 
    var vArguments=this;
    var sFeatures='';
    if (sURL==null||sURL=='') 
    { 
        alert ("Invalid URL input."); 
        return false; 
    } 
    if (vArguments==null||vArguments=='') 
    { 
        vArguments=''; 
    } 
    if (sFeatures==null||sFeatures=='') 
    { 
        sFeatures=dFeatures; 
    } 
    if (window.navigator.appVersion.indexOf("MSIE")!=-1) 
    { 
        window.showModalDialog ( sURL, vArguments, sFeatures ); 
        return false; 
    } 
    else
    {
         newwindow=window.open(sURL,'name','height=600px,width=700px,left=100px,top=100px,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if(window.focus) 
        {
            newwindow.focus()
         }         
         return false;
    }
   /* sFeatures = sFeatures.replace(/ /gi,''); 
    aFeatures = sFeatures.split(";"); 
    sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,chrome=yes,location=no,dialog=yes,minimizable=no,"; 
    
    for ( x in aFeatures ) 
    { 
        aTmp = aFeatures[x].split(":"); 
        sKey = aTmp[0].toLowerCase(); 
        sVal = aTmp[1]; 
        switch (sKey) 
        { 
            case "dialogheight": 
                sWinFeat += "height="+sVal+","; 
                pHeight = sVal; 
                break; 
            case "dialogwidth": 
                sWinFeat += "width="+sVal+","; 
                pWidth = sVal; 
                break; 
            case "dialogtop": 
                sWinFeat += "screenY="+sVal+","; 
                break; 
            case "dialogleft": 
                sWinFeat += "screenX="+sVal+","; 
                break; 
            case "resizable": 
                sWinFeat += "resizable="+sVal+","; 
                break; 
            case "status": 
                sWinFeat += "status="+sVal+","; 
                break; 
            case "center": 
                if ( sVal.toLowerCase() == "yes" ) 
                { 
                   // sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+","; 
                    //sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+","; 
                } 
                break; 
        } 
    } 
    //var lscroll = document.documentElement.clientWidth/2 + document.documentElement.scrollLeft -150;//left
    //var tscroll = document.documentElement.clientHeight/2 + document.documentElement.scrollTop -100;//top
    sWinFeat += "screenY=275";//+lscroll;
    sWinFeat += ",screenX=250";//+tscroll;
    modalWin=window.open(String(sURL),"",sWinFeat); 
    
    if (vArguments!=null&&vArguments!='') 
    { 
        modalWin.dialogArguments=vArguments; 
    }
    */
} 

function checkFocus() 
    { 
    if (window.navigator.appVersion.indexOf("MSIE")==-1) 
        { 
        if (modalWin!=null && !modalWin.closed) 
        { 
            self.blur(); 
            modalWin.focus(); 
        } 
    } 
} 
function fnSetValues()
{
   var iHeight=320;
   var iWidth=650;
   //resizable:{ yes | no | 1 | 0 | on | off }
   //status:{ yes | no | 1 | 0 | on | off }
      

   var sFeatures="dialogHeight: " + iHeight + "px;dialogWidth: " + iWidth + "px;";
   sFeatures=sFeatures+ "status:no;resizable:no;";
   sFeatures=sFeatures+ "center: Yes;resizable: No;help: No;edge: Raised;";
   return sFeatures;
}

//code to create div for sig search
function DivCenter(divSigSearch,height,width)
{
    try
    {
        var lscroll = document.documentElement.clientWidth/2 + document.documentElement.scrollLeft -150;//left
        var tscroll = document.documentElement.clientHeight/2 + document.documentElement.scrollTop -200;//top
            
        
        if(navigator.appName == "Microsoft Internet Explorer")
        {
            //document.getElementById(divSigSearch).style.display="none";
            
                
            if(document.getElementById(divSigSearch)!=null)
            {
                document.getElementById(divSigSearch).style.height=height;
                document.getElementById(divSigSearch).style.width=width;
                //document.getElementById(divSigSearch).style.display="none";
                document.getElementById(divSigSearch).style.left=lscroll;
                document.getElementById(divSigSearch).style.top=tscroll;
                
                //document.getElementById(divSigSearch).style.display="block";
            }
        }
        else
        {        
            document.getElementById(divSigSearch).style.height=height+'px';
            document.getElementById(divSigSearch).style.width=width+'px';                
            document.getElementById(divSigSearch).style.left=lscroll+'px';
            document.getElementById(divSigSearch).style.top=tscroll+'px';
           // alert(document.getElementById(divSigSearch).style.left);
//            alert('top=' + document.documentElement.scrollLeft);
//            alert(document.getElementById(divSigSearch).style.top)
        }
    }
    catch(e)
    {

    }
}

//Start of Code of FcClinicMaster master page

function Menu(path,hdnid)
    {
        document.getElementById(hdnid).value=path;
        __doPostBack('myMenu','');
    }
    
    function SubmitCancel()
    {
        __doPostBack('btnCancel','Cancel');
        return false;
    }
	function Move_Focus(obj,evt,len,next_field)
	{
	    var StartingNum = 47;// ascii equivalent of numeric 0 in 48
	    var EndingNum = 58;//ascii equivalent of numeric 9 is 57
	    if(event.keyCode>StartingNum && event.keyCode<EndingNum)
	    {
		    var phone_field_length;
		    if (evt == 'down') {
			    phone_field_length=obj.value.length;
		    }
		    else if (evt == 'up') 
		    {
			    if (obj.value.length != phone_field_length) 
			    {
				    phone_field_length=obj.value.length;
				    if (phone_field_length == len) 
				    {
				        document.getElementById(next_field).select();
					    document.getElementById(next_field).focus();
				    }
			    }
		    }
	    }
	}
	
function onKeyDown(e)
 {
  
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
        // current pressed key
        var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();

         if (event.ctrlKey && (pressedKey == "c" || pressedKey == "v"))
          {
            // disable key press porcessing
            event.returnValue = false;
          }
   }
  else
   {
          // current pressed key
          var myevent = e ? e : window.event;
           //alert(window.event) ? event.keyCode : e.keyCode);
          //var pressedKey = String.fromCharCode(myevent.keyCode).toLowerCase();
          
          if (myevent.ctrlKey && (myevent.keyCode == 67 ||myevent.keyCode == 86))
           {
            // disable key press porcessing
               //myevent.returnValue = false;
               e.preventDefault();
           }
  }
 
} // onKeyDown

//End of code of FcClinicMaster master page
//code for fcclinic user control

function checkKey()
{     
 try
    {                     
    if(event.keyCode==13 && document.getElementById('<%=btnGo.ClientID%>').value !=null)
    {               
        //document.getElementById('<%=btnGo.ClientID%>').click();              
       
        document.getElementById('<%=inputctr.ClientID%>').value='hello';
        __doPostback('goutam','goutam');            
       
    } 
   }
    catch(e)
    {}   
}
        
//end of code for fcclinic user control

//code for popup
function PopUp(itemid,CouponID)
{
window.open("Shopping/CouponsDetails.aspx?ItemId=" + itemid + "&CouponID="+ CouponID,"PopUp",'toolbar=no,location=no,top=150,left=250,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=700'); 
return false;
}
function PopUp1(CouponID,CouponTypeID)
{
window.open("../Shopping/CouponsDetails.aspx?CouponID=" + CouponID + "&CouponTypeID="+ CouponTypeID,"PopUp",'toolbar=no,location=no,top=100,left=150,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=700'); 
return false;
}

function Cover(bottom, top, ignoreSize) {
var location = Sys.UI.DomElement.getLocation(bottom);
top.style.position = 'absolute';
top.style.top = (window.screen.width - 200) / 2 + 'px';
top.style.left = (window.screen.height - 200) / 2 + 'px';
if (!ignoreSize) {
top.style.height = bottom.offsetHeight + 'px';
top.style.width = bottom.offsetWidth + 'px';
}
}
//end
//code to show popup
function ShowPopupDefault(href)
{
window.open(href,'','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=750');
return false;
}
//end of code
// code to stop copy paste functionality
function onKeyDown(e)
 {
if (navigator.appName == 'Microsoft Internet Explorer')
{ 
var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();

 if (event.ctrlKey && (pressedKey == "c" || pressedKey == "v"))
{
event.returnValue = false;
}
 }
else
 {
var myevent = e ? e : window.event;
 if (myevent.ctrlKey && (myevent.keyCode == 67 ||myevent.keyCode == 86))
 {
 e.preventDefault();
 }
}
} 

//end
function SubmitCancel()
{
__doPostBack('btnCancel','Cancel');
return false;
}

function HideLoadingMsg() 
{var divLoadingMessage = document.getElementById('divLoadingMsg');
 if (divLoadingMessage != null && typeof(divLoadingMessage) != 'undefined') 
{divLoadingMessage.style.display='none'; 
divLoadingMessage.parentNode.removeChild(divLoadingMessage); }} 
var browser = "";
function attachEventListener(target, eventType, functionRef, capture)
{if(typeof target.addEventListener != "undefined")
{window.addEventListener("load", HideLoadingMsg, true);
browser = "standards";}
else{target.attachEvent("on" + "load", HideLoadingMsg);
 browser = "non-standards";}}
 function engage(){alert(browser);} 
attachEventListener(window, "load", engage, true);

function Cover(bottom, top, ignoreSize) {
var location = Sys.UI.DomElement.getLocation(bottom);
top.style.position = 'absolute';
 top.style.top = (window.screen.width - 200) / 2 + 'px';
top.style.left = (window.screen.height - 200) / 2 + 'px';
if (!ignoreSize) {
top.style.height = bottom.offsetHeight + 'px';
top.style.width = bottom.offsetWidth + 'px';
}
}
function Menu1(path,hdnid)
{        
    document.getElementById(hdnid).value=path;        
    __doPostBack('myMenu1','');
} 
