﻿document.status = ' ';


document.cookie=null;
function StartPlayer ()
    {   
    
    document.getElementById("ctl00_ContentPlaceHolder1_audio_a").style.display='none';
    document.getElementById("ctl00_ContentPlaceHolder1_audio_b").style.display='block';
        var p=document.getElementById("Player1");
        var q=document.getElementById("txtAudio");        
        p.URL=q.value;        
    }

function StopPlayer ()
{
 document.getElementById("ctl00_ContentPlaceHolder1_audio_b").style.display='none';
    document.getElementById("ctl00_ContentPlaceHolder1_audio_a").style.display='block';
    var p=document.getElementById("Player1");
    p.controls.stop(); 
    
}

 var prm = Sys.WebForms.PageRequestManager.getInstance();

 prm.add_initializeRequest(prm_InitializeRequest);
 prm.add_endRequest(prm_EndRequest);

 function prm_InitializeRequest(sender, args) {

     $get('IndexContainer').style.cursor = 'wait'; 

     $get(args._postBackElement.id).disabled = true;
 }
 function prm_EndRequest(sender, args) {
       $get('IndexContainer').style.cursor = 'auto';
     $get(sender._postBackSettings.sourceElement.id).disabled = false;
 }

 function pageLoad() {

        var manager = Sys.WebForms.PageRequestManager.getInstance();

        manager.add_endRequest(endRequest);

    }

function endRequest(sender, args) {

    window.scrollTo(0, 0);

}

var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) 
{
   if(self.pageYOffset)
     {	
       rX = self.pageXOffset;	
       rY = self.pageYOffset;
     }
 	else if(document.documentElement && document.documentElement.scrollTop)
 	 {
 	 	rX = document.documentElement.scrollLeft;
 	 	rY = document.documentElement.scrollTop;
 	 }
 	else if(document.body) 
 	{	
 	    rX = document.body.scrollLeft;
 	 	rY = document.body.scrollTop;
 	}
 	 if(document.all)
 	  {	
 	 	  cX += rX;
 	      cY += rY;
 	  }
 	 d.style.left = (cX+10) + "px";
 	 d.style.top = (cY-300) + "px";
 }
 function ShowThumbnail(imgpathMY,imgpathMW,minCaratWeight,maxCaratWeight)
  {   
      var is_Mozila=(navigator.userAgent.indexOf('Firefox') !=-1);	 					  		  		 
	  var objMW,objMY,objdiv,dd,objmincw,objmaxcw,objequalcw;
      objMW=document.getElementById("imgMY");
      objMY=document.getElementById("imgMW");  
      objmincw=document.getElementById("ctl00_ContentPlaceHolder1_lblMinCTW");
      objmaxcw=document.getElementById("ctl00_ContentPlaceHolder1_lblMaxCTW"); 
      objequalcw=document.getElementById("ctl00_ContentPlaceHolder1_lblEqCTW");       
      if(is_Mozila)
      {
      objmincw.textContent=minCaratWeight;
      objmaxcw.textContent=maxCaratWeight;
      objequalcw.textContent=maxCaratWeight;
      }
      else
      {    
      objmincw.innerText=minCaratWeight;
      objmaxcw.innerText=maxCaratWeight;
      objequalcw.innerText=maxCaratWeight;
      }
       if(minCaratWeight==maxCaratWeight && minCaratWeight!="0.00" && maxCaratWeight!="0.00")
       {
          document.getElementById("ctl00_ContentPlaceHolder1_trPopupEq").style.display="block";
          document.getElementById("ctl00_ContentPlaceHolder1_trPopup").style.display="none";
        }  
        else if(minCaratWeight!=maxCaratWeight && minCaratWeight!="0.00" && maxCaratWeight!="0.00")
        {
          document.getElementById("ctl00_ContentPlaceHolder1_trPopupEq").style.display="none";
          document.getElementById("ctl00_ContentPlaceHolder1_trPopup").style.display="block";
        }  
      objMW.src=imgpathMY;
      objMY.src=imgpathMW;     
      dd=document.getElementById("popup");
	  AssignPosition(dd);
	  dd.style.display = "block";
  }
 function HideThumbnail()
  { 	 					  		  		   
    document.getElementById("popup").style.display = "none";
  }
function ReverseContentDisplay()
  {
    var dd = document.getElementById("popup");
    AssignPosition(dd);
    if(dd.style.display == "none")
  { 
    dd.style.display = "block";
  }
  else 
  { 
  dd.style.display = "none";
  }
}
 	 			


