function AddPopUpNew(fileName)
{
	var height = 530;
	var width = 740;	
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=no,"
	+ "menubars=no,toolbars=no,resizable=no,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup",windowprops);
}

function AddPopUp(fileName,height,width){
	var windowprops="height=" + height + ",width=" + width + ",location=no,scrollbars=no,"
	+ "menubars=no,toolbars=no,resizable=yes,titlebar=no";
	var URL=fileName;
	popup=window.open(URL,"MenuPopup",windowprops);
}
function isEmpty(str)
{
	var i;
	var len;
	len = str.length;
	for(i=0; i<str.length && str.charAt(i)==' '; i++);
	if(i==len)
	   return true;
	return false;
}
function isNumeric(str)
{
  for (var i=0; i < str.length; i++)
		{
    var ch = str.substring(i, i+1)
    if( ch < "0" || ch>"9" || str.length == null)
    {
      return false
    }
  }
  return true
}	


 function setzindex(element, effect)
 {
	
	if (effect[0].effect.direction == 1)
	{
	element.style.zIndex=zindexStart;
	
		//seems that IE needs a seperate solution
		if(/MSIE 6.0/.test(navigator.userAgent) && /Windows NT 5.1/.test(navigator.userAgent))
		{
				Spry.Effect.setStyleProp(	element.parentNode, 'zIndex', zindexStart);
				//element.parentNode.style.zIndex = zindexStart;
		}

	}
	zindexStart++;
 }


 function resetzindex(element, effect)
 {
	if (effect[0].effect.direction == 2)
	{
 		 element.style.zIndex=1;
		
		if(/MSIE 6.0/.test(navigator.userAgent) && /Windows NT 5.1/.test(navigator.userAgent))
		 {
			Spry.Effect.setStyleProp(	element.parentNode, 'zIndex', 1);
		 }
	}
	
}

function toggleThumb(targetElement)
{
	Spry.Effect.GrowShrink(targetElement, {duration: 400, from: '100%', to: '150%', toggle: true, setup:setzindex, finish:resetzindex});
}
function cancelForm(fileName){
  rr = window.confirm("Are your sure to Cancel the current operation?");
  if(rr)
    window.location.replace(fileName);
}

function closeForm(){
  rr = window.confirm("Are your sure to Cancel the current operation?");
  if(rr)
    window.close();
}

function rnd(jVal)
{
jVal=(Math.round(jVal*100)) /100;
jVal=dec2(jVal);
return jVal;
}
function dec2(iValue)
{
    sValue = iValue.toString();

	    if (sValue.indexOf(".") == -1)
	    {
	        sValue = sValue + ".00";
	    }
	    else
	    {
	        if (sValue.indexOf(".") == sValue.length - 1)
	        {
	            sValue = sValue + "00";
	        }
	        else if (sValue.indexOf(".") == sValue.length - 2)
	        {
	            sValue = sValue + "0";
	        }
	    }
    
return sValue;
}
function dec3(iValue)
{
    sValue = iValue.toString();

	    if (sValue.indexOf(".") == -1)
	    {
	        sValue = sValue + ".000";
	    }
	    else
	    {
	        if (sValue.indexOf(".") == sValue.length - 1)
	        {
	            sValue = sValue + "000";
	        }
	        else if (sValue.indexOf(".") == sValue.length - 2)
	        {
	            sValue = sValue + "00";
	        }
	        else if (sValue.indexOf(".") == sValue.length - 3)
	        {
	            sValue = sValue + "0";
	        }
	    }
    
return sValue;
}

function getPClicked(objThis, objParent){
	if (objThis.checked == true){
		objParent.checked = true;
	}
	if (objThis.checked == false){
		var oAttribs = objThis.attributes;
	               var oAttr = oAttribs.getNamedItem("parent");
		 var parentName = oAttr.value;
		if (parentName != ""){
			if (cntChildChk(parentName) <= 0)
			    objParent.checked=false;
		}
	}
}

function cntChildChk(parent){
	objParent = eval("document.AssignPerm." + parent);
	var cntChild = 0;
	for (var i=0;i<document.AssignPerm.elements.length;i++){
		var e = document.AssignPerm.elements[i];
		if (e.type == "checkbox"){
		    var oAttrColl = e.attributes;
		    var oAttr = oAttrColl.getNamedItem("parent");
		    if (oAttr.value == parent){
			if (e.checked)
			    cntChild = cntChild + 1
		    }
		}
	}
	return cntChild;
}

function getChldClicked(objThis, objParent){
	for (var i=0;i<document.AssignPerm.elements.length;i++){
	    var e = document.AssignPerm.elements[i];
	    if (e.type == "checkbox"){
		var ee = e.name;
		r = ee.search("" + objThis.name + "");
		if (r>= 0)
			e.checked = objThis.checked;
	    }
	}
}
function AddPopUp1(fileName,height,width,loc,scrol,menu,tool,resiz,title){
	var windowprops="height=" + height +" ,width="+ width +" ,location="+loc+",scrollbars="+scrol+", menubars="+menu+",toolbars="+tool+",resizable="+resiz+",titlebar="+title;
	var URL=fileName;
	popup=window.open(URL,"MenuPopup",windowprops);
}
function Qty(obj)
{
	alert(obj);
}

var Text1="Indian Book Depot (Map House) - Publishers of Maps, Charts, Atlases & Children Books.";
var Text="";
var Pos=1

function UpdateStatusBar1()
{
	window.status=Text.substring(0,Pos++)
	if (Pos==Text.length) Pos=0
	setTimeout("UpdateStatusBar()",Math.random()*100)	
}

timeID = 10000;
stcnt = 16;
wmsg = new Array(100);
        wmsg[0]=Text;
        blnk = "                                                               ";
        for (i=1; i<32; i++)
        {
                b = blnk.substring(0,i);
                wmsg[i]="";
                for (j=0; j<Text.length; j++) wmsg[i]=wmsg[i]+Text.charAt(j)+b;
        }

function UpdateStatusBar()
{
        if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
        if (stcnt-- < -40) stcnt=31;
        status = str;
        clearTimeout(timeID);
        timeID = setTimeout("UpdateStatusBar()",100);
}

 imagename='';
	function enlrge(imgnme) {
		lrgewin=window.open("about:blank","","height=200,width=200")
		imagename=imgnme;
		setTimeout('update()',800)
	}
	function win(fileName)
		{
		myFloater=window.open('','myWindow','scrollbars=auto,status=no,left=10,top=10,width=400,height=300')
		myFloater.location.href=fileName;
		}
	function update() {
	doc=lrgewin.document;
	doc.open('text/html');
	doc.write('<HTML><HEAD><TITLE>Jaipur Golden Hospital :: Enlarged Image<\/TITLE><\/HEAD><BODY bgcolor="white" onLoad="if  (self.resizeTo)self.resizeTo((document.images[0].width+10),(document.images[0].height+40))" topmargin="4" leftmargin="0" rightmargin="0" bottommargin="0"><table width=""' + document.images[0].width + '" border="0" cellspacing="0" cellpadding="0"><tr><td>');
	doc.write('<IMG SRC="' + imagename + '"><\/td><\/tr>');
	doc.write('<\/table><\/BODY><\/HTML>');
	doc.close();
	}
	
	