
 	var viewType = "";
	var sortedBy = "";	
	var sImgExpandedArrow = "";	
 	var sImgDefaultArrow = "";
	var sBW = "";
	var vcookiebtn = "";
	var vtmpsubmit;
	var itemDisplaySearch = "";	
	
    if (navigator.appName == "Microsoft Internet Explorer") 
	{
		sBW = "Microsoft Internet Explorer";
	}
	else if (navigator.appName == "Netscape") {
		sBW = "Netscape";
	}	

	
//	function hidestatus()
//	{
//        window.status='';
//        return true;
//    }
//    
//    if (document.layers)
//    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
//    document.onmouseover=hidestatus;
//    document.onmouseout=hidestatus;

	function MakeBlank(sID)	
	{	   
	    if (sBW == "Microsoft Internet Explorer") 
	    {
			var oesid = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var oesid = document.getElementById(sID);
		}
		oesid.value = '';
		oesid.focus();
	}		
	function vsubmit(vtmpstr) 
	{
		vtmpsubmit = vtmpstr;
	}

	function setfocusitem(sID) {
		if (sBW == "Microsoft Internet Explorer") 
		{
			var oesid = document.all.item(sID);
		}
		else if (sBW == "Netscape") 
		{
			var oesid = document.getElementById(sID);
		}
		oesid.focus();
	}

	function fdisableitem(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl = document.getElementById(sID);
		}
		otbl.disabled = true;
	}

	function chngtrcolor(sID,clr1,clr2) {
		if (sBW == "Microsoft Internet Explorer") 
		{
			var otbl = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl = document.getElementById(sID);
		}
		
		if (otbl.className == clr1) {
			otbl.className = clr2;
		}
		else if (otbl.className == clr2) {
			otbl.className = clr1;
		}
	}

	function chngfntclass(sID,clr1,clr2) 
	{	
		if (sBW == "Microsoft Internet Explorer") 
		{
			var otblfnt = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otblfnt = document.getElementById(sID);
		}				
		if (otblfnt.className == clr1) 
		{
		 
			otblfnt.className = clr2;
		}
		else if (otblfnt.className == clr2)
		{
			otblfnt.className = clr1;
		}
	}

	function chngimg(sID,img1,img2, st) 
	{
		if (sBW == "Microsoft Internet Explorer") 
		{
			var oImage = document.all.item(sID);
		}
		else if (sBW == "Netscape") 
		{
			var oImage = document.getElementById(sID);
		}
		
		if (st == 'on') 
		{
			oImage.src = img2;
		}
		else if (st == 'off') 
		{
			oImage.src = img1;
		}
	}

	function chngimg1(sID,img1,img2) 
	{
	    
		if (sBW == "Microsoft Internet Explorer")
		 {
			var oImage = document.all.item(sID);
		}
		else if (sBW == "Netscape")
		 {
			var oImage = document.getElementById(sID);
		}
			
		if (oImage.alt == 'Collapse') 
		{
			oImage.src = img2;
			oImage.alt = 'Expand';
		}
		else if (oImage.alt == 'Expand') 
		{
			oImage.src = img1;
			oImage.alt = 'Collapse';
		}
	}
    
    function chngcustombasket(sID,img1,img2,lbl) 
	{
	    
		if (sBW == "Microsoft Internet Explorer")
		 {
			var oImage = document.all.item(sID);
			var olbl = document.all.item(lbl);
		}
		else if (sBW == "Netscape")
		 {
			var oImage = document.getElementById(sID);
			var olbl = document.getElementById(lbl);
		}
		if (oImage.alt == 'Collapse') 
		{
			oImage.src = img2;
			oImage.alt = 'Expand';
			olbl.value = 'Show custom gift basket items';
		}
			
		else if (oImage.alt == 'Expand') 
		{
			oImage.src = img1;
			oImage.alt = 'Collapse';
			olbl.value = 'Hide custom gift basket items';
		}
		
	}

	function chngimgexpand(sID,img1,img2)
	 {
		if (sBW == "Microsoft Internet Explorer")
		{
			var oImage = document.all.item(sID);
		}
		else if (sBW == "Netscape") 
		{
			var oImage = document.getElementById(sID);
		}
		
		if (oImage.alt == 'Expand') 
		{
			oImage.src = img1;
			oImage.alt = 'Collapse';
		}
	}

	function rbmenuchange(sID) 
	{
		if (sBW == "Microsoft Internet Explorer") 
		{
			var orbml = document.all.item("rbml" + sID);
			var orbmbg = document.all.item("rbmbg" + sID);
			var orbmf = document.all.item("rbmf" + sID);
			var orbmr = document.all.item("rbmr" + sID);
		} 
		else if (sBW == "Netscape")
		{
			var orbml = document.getElementById("rbml" + sID);
			var orbmbg = document.getElementById("rbmbg" + sID);
			var orbmf = document.getElementById("rbmf" + sID);
			var orbmr = document.getElementById("rbmr" + sID);
		}
		
		if (orbmbg.className == "") 
		{
			orbml.className = "redbarmenuleft";
			orbmbg.className = "redbarmenubg";
			orbmf.className = "redbarmenuhover";
			orbmr.className = "redbarmenuright";
		}
		else if (orbmbg.className == "redbarmenubg")
		{
			orbml.className = "";
			orbmbg.className = "";
			orbmf.className = "redbartext";
			orbmr.className = "";
		}
	}


	function showhidedetails(sID)
	 {	 
	       	 
		if (sBW == "Microsoft Internet Explorer")
		 {
			var otbl1 = document.all.item(sID);
		}
		else if (sBW == "Netscape") 
		{
			var otbl1 = document.getElementById(sID);
		}
		
		if (otbl1.style.display == "none") 
		{
		
			otbl1.style.display = "";
		}
		else if (otbl1.style.display == "") 
		{
		
			otbl1.style.display = "none";
		}
	}

	function showonlydetails(sID) {	
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById(sID);
		}

		if (otbl1.style.display == "none") {
			otbl1.style.display = "";
		}
	}
	
	function hideonlydetails(sID) 
	{	
		if (sBW == "Microsoft Internet Explorer") 
		{
			var otbl1 = document.all.item(sID);
		}
		else if (sBW == "Netscape") 
		{
			var otbl1 = document.getElementById(sID);
		}

		if (otbl1.style.display == "") 
		{
			otbl1.style.display = "none";
		}
	}

	function chngview(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item("tr"+sID);
			var otblttl = document.all.item("title"+sID);
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById("tr"+sID);
			var otblttl = document.getElementById("title"+sID);
		}

		if (otbl1.style.display == "none") {
			otbl1.style.display = "";
			otblttl.className = "fmtback2";
		}
		else if (otbl1.style.display == "") {
			otbl1.style.display = "none";
			otblttl.className = "fmtback1";
		}
	}

	function openDesc(vUrl) {
		window.open(vUrl,'Details','height=250,width=400,left=100,top=100,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no',true);
	}

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
		if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}

	function ltrim(argvalue) {
		while (1) {
	    		if (argvalue.substring(0, 1) != " ")
	      		break;
	    		argvalue = argvalue.substring(1, argvalue.length);
		}
	 	return argvalue;
	}

	function rtrim(argvalue) {
		while (1) {
			if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
			break;
			argvalue = argvalue.substring(0, argvalue.length - 1);
		}
		return argvalue;
	}

	function trim(argvalue) {
		var tmpstr = ltrim(argvalue);
		return rtrim(tmpstr);
	}

	function numCheck(argvalue) {
	var digits = "0123456789.";
		if (argvalue.length == 0)
		return false;

		for (var n = 0; n < argvalue.length; n++)
			if (digits.indexOf(argvalue.substring(n, n+1)) == -1)
			return false;
		return true;
	}
	
	function zipCheck(argvalue,strname) {
	var allValid = true;    
	var digits = "0123456789-";
		if (argvalue.length == 0)
		{
		    allValid=false;		    
		}

		for (var n = 0; n < argvalue.length; n++)
		{
			if (digits.indexOf(argvalue.substring(n, n+1)) == -1)
			{
			    allValid=false;
			}
		}	
		if (allValid==false)
        {
            alert('Invalid ' + strname + ' - must enter number ');             
            return false;
        }
		return true;
	}

	function isEmail(argvalue) {
		if (argvalue.indexOf(" ") != -1)
			return false;
		else if (argvalue.indexOf("@") == -1)
    			return false;
		else if (argvalue.indexOf("@") == 0)
			return false;
		else if (argvalue.indexOf("@") == (argvalue.length-1))
			return false;		
		var retSize = customSplit(argvalue, "@", "arrayString");

		if (arrayString[1].indexOf(".") == -1)
			return false;
		else if (arrayString[1].indexOf(".") == 0)
    			return false;
		else if (arrayString[1].charAt(arrayString[1].length-1) == ".") {
			return false;
		}
		return true;
	}

	function customSplit(strvalue, separator, arrayName) {
  		var n = 0;

  		if (separator.length != 0) {
			while (strvalue.indexOf(separator) != -1) {
				eval("arr"+n+" = strvalue.substring(0, strvalue.indexOf(separator));");
				strvalue = strvalue.substring(strvalue.indexOf(separator)+separator.length,
				strvalue.length+1);
				n++;
			}
			eval("arr" + n + " = strvalue;");
			arraySize = n+1;
		}
  		else {
			for (var x = 0; x < strvalue.length; x++) {
				eval("arr"+n+" = \"" + strvalue.substring(x, x+1) + "\";");
				n++;
			}
			arraySize = n;
		}

		eval(arrayName + " = new makeArray(arraySize);");

		for (var i = 0; i < arraySize; i++)
		eval(arrayName + "[" + i + "] = arr" + i + ";");

		return arraySize;
	}

	function makeArray(IntarrSize) {
		for (var n = 0; n < IntarrSize; n++)
		this[n] = "";
		return this;
	}

	function fshowdetails(vtr) {	
		if (sBW == "Microsoft Internet Explorer") {
			var otr = document.all.item(vtr);
		}
		else if (sBW == "Netscape") {
			var otr = document.getElementById(vtr);
		}
	
		if (otr.style.display == "") {
			otr.style.display = "none";
		}
		else if (otr.style.display == "none") {
			otr.style.display = "";
		}
	}



	function chngsteps(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item("step1");
			var otbl2 = document.all.item("step2");
			var otbl3 = document.all.item("step3");
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById("step1");
			var otbl2 = document.getElementById("step2");
			var otbl3 = document.getElementById("step3");
		}

		otbl1.style.display = "none";
		otbl2.style.display = "none";
		otbl3.style.display = "none";

		if (sID == "1") {
			otbl1.style.display = "";
		}
		else if (sID == "2") {
			otbl2.style.display = "";
		}
		else if (sID == "3") {
			otbl3.style.display = "";
		}
	}

	function chngCLick(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl = document.all.item("Tbl" + sID);
			var ofont = document.all.item("font" + sID);
		}
		else if (sBW == "Netscape") {
			var otbl = document.getElementById("Tbl" + sID);
			var ofont = document.getElementById("font" + sID);
		}
		
		otbl.className = "MenuClick";
		ofont.className = "mfclick";
	}

	function chngArrow(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl = document.all.item("Tbl" + sID);
			var ofont = document.all.item("font" + sID);
		}
		else if (sBW == "Netscape") {
			var otbl = document.getElementById("Tbl" + sID);
			var ofont = document.getElementById("font" + sID);
		}
		
		if (otbl.className == "MenuHover") {
			otbl.className = "MenuPlain";
			ofont.className = "mfplain";
		}
		else if (otbl.className == "MenuPlain") {
			otbl.className = "MenuHover";
			ofont.className = "mfhover";
		}
		else if (otbl.className == "MenuClick") {
			otbl.className = "MenuClick";
			ofont.className = "mfclick";
		}
	}

	function selectfirst(SID) {
		if (sBW == "Microsoft Internet Explorer") {
			var oselect = document.all.item(SID);
		}
		else if (sBW == "Netscape") {
			var oselect = document.getElementById(SID);
		}
		oselect.selectedIndex = 0;
	}

	function maketheBalloon(sid, width, message) {
		var theString = '<STYLE TYPE="text/css">#'+sid+'{width:'+width+';}</STYLE>';
		theString += '<DIV CLASS="balloon" id="'+sid+'">'+message+'</DIV >';
		document.write(theString);
	}

	function makeItVisible(sid, event) {
		if (sBW == "Netscape") {
			var oid1 = document.getElementById(sid);
			oid1.left = event.pageX + 10;
		      	oid1.top = event.pageY + 10;
			oid1.visibility = "show";
		}
		else if (sBW == "Microsoft Internet Explorer") {
			var oid1 = document.all.item(sid);
			oid1.style.pixelLeft = (document.body.scrollLeft + event.clientX) + 10;
		      	oid1.style.pixelTop = (document.body.scrollTop + event.clientY) + 10;
			oid1.style.visibility = "visible";
		}
	}
	
	function hideHelp(sid) {
		if (sBW == "Netscape") {
			var oid1 = document.getElementById(sid);
			oid1.visibility = "hide";
		}
		else if (sBW == "Microsoft Internet Explorer") {
			var oid1 = document.all.item(sid);
			oid1.style.visibility = "hidden";
		}
	}
	
	function printHidden(SID, vtitle) {

		if (sBW == "Microsoft Internet Explorer") {
			var otbl2 = document.all.item(SID);
		}
		else 
		{
			var otbl2 = document.getElementById(SID);
		}		
		document.body.insertAdjacentHTML('beforeEnd','<iframe name=printHiddenFrame width=0 height=0></iframe>');
		var doc = printHiddenFrame.document;
		doc.open();	
		doc.write("<table style='vertical-align:top;BORDER-LEFT: #000000 dashed 1px; BORDER-RIGHT: #000000 dashed 1px; BORDER-TOP: #000000 dashed 1px; BORDER-BOTTOM: #000000 dashed 1px;' width=150px height=80px cellspacing=0 align=left  cellpadding=4>");		
		doc.write(otbl2.innerHTML);
		doc.write("</table>");						
		doc.close();
		//alert(printHiddenFrame.document.body.innerHTML);
		printHiddenFrame.focus();
		printHiddenFrame.print();
	}
	
	function printHiddenCustomLabel(SID, vtitle)
	 {	   
		if (sBW == "Microsoft Internet Explorer") {
			var otbl2 = document.all.item(SID);
		}
		else 
		{
			var otbl2 = document.getElementById(SID);
		}		
		document.body.insertAdjacentHTML('beforeEnd','<iframe name=printHiddenFrame width=0 height=0></iframe>');
		var doc = printHiddenFrame.document;
		doc.open();		
		doc.write("<table><tr><tD>");					
		doc.write(otbl2.innerHTML);	
		doc.write("</td></tr></table>");		
		doc.close();		
		//alert(printHiddenFrame.document.body.innerHTML);		
		printHiddenFrame.focus();
		printHiddenFrame.print();
	}		

	function JSFX_FloatTopDiv(SID)
	{
		//Enter "frombottom" or "fromtop"
		var verticalpos="fromtop";

		if (sBW == "Microsoft Internet Explorer") {
			var el = document.all.item(SID).style;
		}
		else {
			var el = document.getElementById(SID).style;
		}

		var startX = el.left,
		startY = 75;

		function ml()
		{
			el.sP=function(x,y){el.left=x;el.top=y;};
			el.x = startX;
			if (verticalpos=="fromtop")
				el.y = startY;
			else{
				if (sBW == "Microsoft Internet Explorer") {
					el.y = document.body.scrollTop + document.body.clientHeight;
				}
				else {
					el.y = pageYOffset + innerHeight;
				}
				el.y -= startY;
			}
			return el;
		}
		window.stayTopLeft=function()
		{
			if (verticalpos=="fromtop"){
				if (sBW == "Microsoft Internet Explorer") {
					var pY = document.body.scrollTop;
				} else {
					var pY = pageYOffset;
				}
				ftlObj.y += (pY + startY - ftlObj.y)/8;
			}
			else{
				if (sBW == "Microsoft Internet Explorer") {
					var pY = document.body.scrollTop + document.body.clientHeight;
				} else {
					var pY = pageYOffset + innerHeight;
				}
				ftlObj.y += (pY - startY - ftlObj.y)/8;
			}
				ftlObj.sP(ftlObj.x, ftlObj.y);
				setTimeout("stayTopLeft()", 10);
		}
		ftlObj = ml();
		stayTopLeft();
	}

	function FormatNumber(num, decimalNum, bolLeadingZero, bolParens)
	   /* IN - num:            the number to be formatted
        	   decimalNum:     the number of decimals after the digit
	           bolLeadingZero: true / false to use leading zero
        	   bolParens:      true / false to use parenthesis for - num
		      RETVAL - formatted number
	   */
	   {
	       var tmpNum = num;

	       // Return the right number of decimal places
	       tmpNum *= Math.pow(10,decimalNum);
	       tmpNum = Math.floor(tmpNum);
	       tmpNum /= Math.pow(10,decimalNum);

	       var tmpStr = new String(tmpNum);

	       // See if we need to hack off a leading zero or not
	       if (!bolLeadingZero && num < 1 && num > -1 && num !=0)
        	   if (num > 0)
	               tmpStr = tmpStr.substring(1,tmpStr.length);
        	   else
	               // Take out the minus sign out (start at 2)
        	       tmpStr = "-" + tmpStr.substring(2,tmpStr.length);                        


	       // See if we need to put parenthesis around the number
	       if (bolParens && num < 0)
        	   tmpStr = "(" + tmpStr.substring(1,tmpStr.length) + ")";

	       return tmpStr;
	}

	function fconfirm(sComment)
	{
		if (sBW == "Microsoft Internet Explorer") {
			var ht = document.all.item("body");
		}
		else if (sBW == "Netscape") {
			var ht = document.getElementById("body");
		}

		ht.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)";

		if (confirm(sComment))
		{
			return true;
		}
		else
		{
			ht.style.filter = "";
			return false;
		}		
	}


	function ajax(ID1,ID2,vsubmit,vpage)
	{         
		if (sBW == "Microsoft Internet Explorer") {
			var oecustselect = document.all.item(ID1);
			var oefproductslno = document.all.item(ID2);
		}
		else if (sBW == "Netscape") {
			var oecustselect = document.getElementById(ID1);
			var oefproductslno = document.getElementById(ID2);
		}

		var req = null; 

		oefproductslno.innerHTML = "Getting values from server ...";
		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject("Microsoft.XMLHTTP");

		req.onreadystatechange = function()
		{ 
			oefproductslno.innerHTML =  "Wait for server ...";
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					oefproductslno.innerHTML = req.responseText;	
				}	
				else	
				{
					oefproductslno.innerHTML = req.statusText;
				}	
			} 
		}; 
		req.open("GET", '<%=session.item("securehttps")%>/html/ex-receiver.asp?submit='+vsubmit+"&page="+vpage+"&id1slno="+oecustselect.options[oecustselect.selectedIndex].value, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 
	}

//-------------------------------              Added for WineCountry         ----------------------------------------------------------------------------------------------------


function emailcheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1)
		{
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
		   alert("Invalid E-mail ID !!");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1)
		{
		    alert("Invalid E-mail ID !!");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1)
		 {
		    alert("Invalid E-mail ID !!");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		 {
		    alert("Invalid E-mail ID !!");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1)
		 {
		    alert("Invalid E-mail ID !!");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1)
		 {
		    alert("Invalid E-mail ID !!");
		    return false;
		 }

 		 return true;					
	}
	
function zipLen(str)
{
   var zipstr  = str ;
   if (zipstr.length < 5) 
   {
        alert ("Length of ZipCode should be atleast 5 !! ");
        return false;
   }  
   return true;
}		
	
function numbersOnly(checkStr,strname)
{    
    var checkOK = "0123456789";
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
        ch = checkStr.charAt(i);
        for (j = 0;  j < checkOK.length;  j++)
        {
            if (ch == checkOK.charAt(j))
                break;
        }
        if (j == checkOK.length)
        {
                allValid = false;
                break;
        }
    }
   
    if (allValid==false)
    {
        alert('Invalid ' + strname + ' !!');             
        return false;
    }
    return true;
}
function maskDate(id,keycode)
    {  
        if (keycode != 8)
        {           
            var odate = '';
            var strodate = '';        
            var i = 0;
            var hasit = 0;
            
            odate = document.getElementById(id);             
            strodate = String(odate.value);              
            if (strodate.length == 2)
            {
                for (i=0; i<strodate.length; i++)
                {
                    if (strodate.charAt(i) == '/')
                    {
                        odate.value = '0' + odate.value;
                        hasit = 1;
                    }
                }
               if (hasit != 1)
                 odate.value = odate.value + "/";
               hasit = 0;                   
            }
            if (strodate.length == 5)
            {      
                for (i=3; i<5; i++)
                {
                    if (strodate.charAt(i) == '/')
                    {
                        if(strodate.charAt(3) != '/')
                            strodate =  strodate.charAt(0) + strodate.charAt(1) + strodate.charAt(2) + '0' +strodate.charAt(3) ;
                        else
                            strodate =  strodate.charAt(0) + strodate.charAt(1) + strodate.charAt(2) + '0' +strodate.charAt(4) ;
                        odate.value = strodate;
                        hasit = 1;
                    }
                } 
                odate.value = odate.value + "/";
                hasit = 0;                                                  
            }        
        }    
        return true;
 }
 function validateDate(id)
 {
     var day = '';    
     var month = '';    
     var year = ''; 
     var odate = '';
     var strodate = ''; 
     var i = 0;
     var leap = 0;
     odate = document.getElementById(id); 
     strodate = String(odate.value);       
     if (strodate.length < 10 && strodate.length > 0)
     {
        alert('Enter date in MM/DD/YYYY');
        odate.value = '';        
        return false;        
     }
     for(i=0;i<strodate.length; i++)
     {
        if(i != 2 && i != 5 && strodate.charAt(i) == '/')
        {
            alert('Invalid date. Enter date in MM/DD/YYYY');
            odate.value = '';
            return false;
        }            
     }
     if (strodate.charAt(0) == '0')
     {
        month = strodate.charAt(1)
     }
     else
     {
        month = strodate.charAt(0) + strodate.charAt(1);    
     }         
    if (month != '' && numbersOnly(month,'Month')== true)
    {
        if (parseInt(month) < 1 || parseInt(month) > 12 )
        {
            alert("Month should be between 1 and 12 !!");
            odate.value = '';           
            return false;
        }       
    }         
    if (strodate.charAt(3) == '0')
    {
        day = strodate.charAt(4);  
    }
    else
    {
        day = strodate.charAt(3) + strodate.charAt(4);  
    }      
    if (day != '' && numbersOnly(day,'Day')== true)
    {        
        if (parseInt(day) < 1 || parseInt(day) > 31 )
        {
            alert("Day should be between 1 and 31 !!");                       
            odate.value = '';          
            return false;
        }                   
        if (parseInt(month) == 4 || parseInt(month) == 6 || parseInt(month) == 9 || parseInt(month) == 11 )
        {
            if (parseInt(day) > 30 )
            {
                alert("Day should be between 1 and 30 !!");                                
                odate.value = '';               
                return false;
            } 
        }  
         if (parseInt(month) == 2 && parseInt(day) > 29  )
        {
            alert("Day should be between 1 and 29 !!");                        
            odate.value = '';           
            return false;
        }          
    } 
    if (strodate.charAt(6) == '0')          
    {
       year = strodate.charAt(7) + strodate.charAt(8) + strodate.charAt(9);      
    }
    if ((strodate.charAt(6) == '0') && (strodate.charAt(7) == '0'))
    {
        year = strodate.charAt(8) + strodate.charAt(9);           
    }
    if ((strodate.charAt(6) == '0') && (strodate.charAt(7) == '0') && (strodate.charAt(8) == '0'))
    {
         year = strodate.charAt(9);                                                 
    }   
    if (strodate.charAt(6) != '0')   
    {
        year = strodate.charAt(6) + strodate.charAt(7) + strodate.charAt(8) + strodate.charAt(9);                                            
    }         
    if (year != '' && numbersOnly(year,'Year')== true)
    {
        if (parseInt(year) < 1) 
        {
            alert("Year should be greater than 0 !!");                        
            odate.value = '';           
            return false;
        }
    }    
    if( (parseInt(year) % 4 == 0) || (parseInt(year) % 100 == 0) || (parseInt(year) % 400 == 0))
    {
       leap = 1;   
    }
    if ((parseInt(month) == 2) && (leap == 1) && (parseInt(day) > 29) && (year != ''))
    {
       alert("Day should be between 1 to 29 !!"); 
       odate.value = '';       
       return false;
    }
    if ((parseInt(month) == 2) && (leap == 0) && (parseInt(day) > 28) && (year != ''))
    {
       alert("Day should be between 1 to 28 !!"); 
       odate.value = '';       
       return false;
    }      
    return true;
 }
 
/*-------------------------------DHTML delete popup function--------------------*/

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e)
{
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)
dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height,tdid)
{   
if (!ie5&&!ns6)
{
    window.open(url,"","width=width,height=height,scrollbars=1")
    
}    
else
{ 
    document.getElementById("dwindow").style.display=''
    document.getElementById("dwindow").style.width=initialwidth=width+"px"
    document.getElementById("dwindow").style.height=initialheight=height+"px"
    document.getElementById("dwindow").style.left= document.getElementById(tdid).offsetLeft ;    
    document.getElementById("dwindow").style.top= document.getElementById(tdid).offsetTop + parseInt(document.getElementById("dwindow").style.height) + 40;    
    document.getElementById("cframe").src=url
}
}

function loadwindowbuttons(url,width,height,tdid,tdid1)
{   
    if (!ie5&&!ns6)
    {
        window.open(url,"","width=width,height=height,scrollbars=1")
        
    }    
    else
    {
        var tbl1 = 0;
        var tbl2 = 0;
        var tbl3 = 0;
        if (document.getElementById("tblproductsindimgplus") != null) 
            tbl1 = document.getElementById("tblproductsindimgplus").offsetHeight;
        if (document.getElementById("tblproductsinddiv") != null) 
            tbl2 = document.getElementById("tblproductsinddiv").offsetHeight;
        if (document.getElementById("tddescprodind") != null) 
            tbl3 = document.getElementById("tddescprodind").offsetHeight ;                        
        document.getElementById("divbuttons").style.display=''
        document.getElementById("divbuttons").style.width=initialwidth=width+"px"
        document.getElementById("divbuttons").style.height=initialheight=height+"px"
        document.getElementById("divbuttons").style.left= document.getElementById("tdproductsindmenu").offsetWidth + document.getElementById(tdid).offsetLeft + document.getElementById("tdproductsind").offsetLeft +document.getElementById("tdproductindmain").offsetLeft - 61;    
        document.getElementById("divbuttons").style.top= document.getElementById(tdid).offsetTop + tbl1 + tbl2 + tbl3 + 364;
        document.getElementById("iframebuttons").src=url     
    }
}

function loadwindowbuttonspremade(url,width,height,tdid,tdid1)
{   
    if (!ie5&&!ns6)
    {
        window.open(url,"","width=width,height=height,scrollbars=1")
        
    }    
    else
    {
        var tbl1 = 0;
        var tbl2 = 0;
        if (document.getElementById("tblproductsprebuiltmain") != null) 
            tbl1 = document.getElementById("tblproductsprebuiltmain").offsetHeight;        
        document.getElementById("divbuttonspremade").style.display=''
        document.getElementById("divbuttonspremade").style.width=initialwidth=width+"px"
        document.getElementById("divbuttonspremade").style.height=initialheight=height+"px"
        document.getElementById("divbuttonspremade").style.left= document.getElementById("tdproductsprebuiltmenu").offsetWidth + document.getElementById(tdid).offsetLeft + document.getElementById("tdproductsprebuilt").offsetLeft +document.getElementById("tdproductprebuiltmain").offsetLeft - 19;    
        document.getElementById("divbuttonspremade").style.top= document.getElementById(tdid).offsetTop + tbl1 + 331;
        document.getElementById("iframebuttonspremade").src=url     
    }
}

function loadwindowprogressbar(url,width,height,tdid)
{  
        if (!ie5&&!ns6)
        {
            window.open(url,"","width=width,height=height,scrollbars=1")        
        }    
        else
        {         
            document.getElementById("dwindow").style.display=''
            document.getElementById("dwindow").style.width=initialwidth=width+"px"
            document.getElementById("dwindow").style.height=initialheight=height+"px"
            document.getElementById("dwindow").style.left= document.getElementById(tdid).offsetLeft + 140 ;    
            document.getElementById("dwindow").style.top= document.getElementById(tdid).offsetTop + parseInt(document.getElementById("dwindow").style.height) + 340;    
            document.getElementById("cframe").src=url
        }
    
}

function loadwindowprogressbarorders(url,width,height)
{  
        if (!ie5&&!ns6)
        {
            window.open(url,"","width=width,height=height,scrollbars=1")        
        }    
        else
        {         
            document.getElementById("dwindowprogressbarorders").style.display=''
            document.getElementById("dwindowprogressbarorders").style.width=initialwidth=width+"px"
            document.getElementById("dwindowprogressbarorders").style.height=initialheight=height+"px"
            document.getElementById("dwindowprogressbarorders").style.left= parseInt(screen.availWidth/2)-100;
            document.getElementById("dwindowprogressbarorders").style.top= parseInt(screen.availHeight/2);
            document.getElementById("cframeprogressbarorders").src=url
        }
    
}

function loadwindowcasecard(url,width,height,tdid)
{
// alert('hi');  
if (!ie5&&!ns6)
{    
    window.open(url,"NewWin","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById("dwindow").style.display='';
    document.getElementById("dwindow").defaultstatus = 'Case Card';    
    document.getElementById("dwindow").style.width=initialwidth=width+"px" ;
    document.getElementById("dwindow").style.height=initialheight=height+"px" ;
    document.getElementById("dwindow").style.left= parseInt((screen.availWidth/2) - (width/2));        
   /* document.getElementById("dwindow").style.top= parseInt((screen.availHeight/2) - (height/2));  */       
    document.getElementById("cframe").src=url    
}
}

function loadwindowrestricted(url,width,height,tdid)
{
// alert('hi');  
if (!ie5&&!ns6)
{    
    window.open(url,"NewWin1","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById("dwindowrest").style.display='';
    document.getElementById("dwindowrest").defaultstatus = 'Case Card';    
    document.getElementById("dwindowrest").style.width=initialwidth=width+"px" ;
    document.getElementById("dwindowrest").style.height=initialheight=height+"px" ;
    document.getElementById("dwindowrest").style.left= parseInt((screen.availWidth/2) - (width/2));        
    /*document.getElementById("dwindowrest").style.top= parseInt((screen.availHeight/2) - (height/2)); */        
    document.getElementById("cframerestricted").src=url    
}
}

function loadwindowverifypack(url, width, height, tdid) {
    // alert('hi');  
    if (!ie5 && !ns6) {
        window.open(url, "NewWin1", "width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")

    }
    else {
        document.getElementById("dwindowpackactive").style.display = '';
        document.getElementById("dwindowpackactive").defaultstatus = 'Case Card';
        document.getElementById("dwindowpackactive").style.width = initialwidth = width + "px";
        document.getElementById("dwindowpackactive").style.height = initialheight = height + "px";
        document.getElementById("dwindowpackactive").style.left = parseInt((screen.availWidth / 2) - (width / 2));
        /*document.getElementById("dwindowrest").style.top= parseInt((screen.availHeight/2) - (height/2)); */
        document.getElementById("cframepackactive").src = url
    }
}

function loadwindowholidaylist(url,width,height,winid)
{
 
if (!ie5&&!ns6)
{    
    window.open(url,"Holidaylist","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById('dwindow' + winid).style.display='';
    document.getElementById('dwindow' + winid).defaultstatus = 'Holiday List';    
    document.getElementById('dwindow' + winid).style.width=initialwidth=width+"px" ;
    document.getElementById('dwindow' + winid).style.height=initialheight=height+"px" ;
    document.getElementById('dwindow' + winid).style.left= parseInt((screen.availWidth/2) - (width/2));        
    document.getElementById('dwindow' + winid).style.top= 0;         
    document.getElementById('cframe' + winid).src=url    
}
return false;
}

function loadwindowcheckage1(url,width,height,winid,tdid)
{
 
if (!ie5&&!ns6)
{    
    window.open(url,"NewWinAge","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById('dwindow' + winid).style.display='';
    document.getElementById('dwindow' + winid).defaultstatus = 'Check Age';    
    document.getElementById('dwindow' + winid).style.width=initialwidth=width+"px" ;
    document.getElementById('dwindow' + winid).style.height=initialheight=height+"px" ;
    document.getElementById('dwindow' + winid).style.left= parseInt((screen.availWidth/2) - (width/2)); 
    document.getElementById('dwindow' + winid).style.top=(window.parent.document.body.scrollTop + 100) + window.parent.document.body.clientHeight;      
    document.getElementById('cframe' + winid).src=url ; 
   
}
return false;
}

   
function loadwindowcheckage(url,width,height,winid)
{
 
if (!ie5&&!ns6)
{    
    window.open(url,"NewWinAge","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById('dwindow' + winid).style.display='';
    document.getElementById('dwindow' + winid).defaultstatus = 'Check Age';    
    document.getElementById('dwindow' + winid).style.width=initialwidth=width+"px" ;
    document.getElementById('dwindow' + winid).style.height=initialheight=height+"px" ;
    document.getElementById('dwindow' + winid).style.left= parseInt((screen.availWidth/2) - (width/2));        
   /* document.getElementById('dwindow' + winid).style.top= parseInt((screen.availHeight/2) - (height/2)); */        
    document.getElementById('cframe' + winid).src=url  
   //  window.scrollTo(0,0);
}
return false;
}


function loadwindowplayvideo(url, width, height, winid) {

    if (!ie5 && !ns6) {
        window.open(url, "Playingvideo", "width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")

    }
    else {
        document.getElementById(winid).style.display = '';
        document.getElementById(winid).defaultstatus = 'Check Age';
        document.getElementById(winid).style.width = initialwidth = width + "px";
        document.getElementById(winid).style.height = initialheight = "500px";
        document.getElementById(winid).style.left = parseInt((screen.availWidth / 2) - (width / 2));
        /* document.getElementById('dwindow' + winid).style.top= parseInt((screen.availHeight/2) - (height/2)); */
        document.getElementById('cframeplay').src = url
        //  window.scrollTo(0,0);
    }
    return false;
}

function loadwindowitems(url,width,height,tdid)
{
// alert('hi');  
if (!ie5&&!ns6)
{    
    window.open(url,"NewWin","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{ 
    document.getElementById("iwindow").style.display='';
    document.getElementById("iwindow").defaultstatus = 'Case Card';    
    document.getElementById("iwindow").style.width=initialwidth=width+"px" ;
    document.getElementById("iwindow").style.height=initialheight=height+"px" ;
    document.getElementById("iwindow").style.left= parseInt((screen.availWidth/2) - (width/2));        
    document.getElementById("iwindow").style.top= parseInt((screen.availHeight/2) - (height/2));         
    document.getElementById("itemframe").src=url    
}
}

function loadwindowcoupondisplay(url,width,height,tdid)
{   

if (!ie5&&!ns6)
{    
    window.open(url,"NewWin","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")
    
}    
else
{  
    document.getElementById("dwindow").style.display='';
    document.getElementById("dwindow").defaultstatus = 'Coupon Display';    
    document.getElementById("dwindow").style.width=initialwidth=width+"px" ;
    document.getElementById("dwindow").style.height=initialheight=height+"px" ;
    document.getElementById("dwindow").style.left= document.getElementById(tdid).offsetLeft + 230 ;     
    document.getElementById("dwindow").style.top= document.getElementById(tdid).offsetTop + 195;        
    document.getElementById("cframe").src=url  
                      
}
}

function loadwindowcustomlabel(url,width,height,tdid)
{   
if (!ie5&&!ns6)
{    
    window.open(url,"NewWin","width=width,height=height,scrollbars=1,status=0,toolbar=0,menubar=0")    
}    
else
{ 
    document.getElementById("dwindow").style.display='';
    document.getElementById("dwindow").defaultstatus = 'Case Card';    
    document.getElementById("dwindow").style.width=initialwidth=width+"px" ;
    document.getElementById("dwindow").style.height=initialheight=height+"px" ;
    document.getElementById("dwindow").style.left= document.getElementById(tdid).offsetLeft + 415 ;     
    document.getElementById("dwindow").style.top= document.getElementById(tdid).offsetTop + 280;        
    document.getElementById("cframe").src=url    
}
}

function loadwindowitemdisplay(url,width,height,tdid)
{   
if (!ie5&&!ns6)
{
    window.open(url,"","width=width,height=height,scrollbars=1")
    
}    
else
{ 
    document.getElementById("dwindow").style.display=''
    document.getElementById("dwindow").style.width=initialwidth=width+"px"
    document.getElementById("dwindow").style.height=initialheight=height+"px"
    document.getElementById("dwindow").style.left= document.getElementById(tdid).offsetLeft + 450;    
    document.getElementById("dwindow").style.top= document.getElementById(tdid).offsetTop + parseInt(document.getElementById("dwindow").style.height) - 15;    
    document.getElementById("cframe").src=url
}
}

function closeit()
    {        
        document.getElementById("dwindow").style.display="none";             
    }

function closeit_item()
    {        
        document.getElementById("iwindow").style.display="none";             
    }

function stopdrag()
{
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
}

function maketheBalloon(sid, width, message)
 {
	var theString = '<STYLE TYPE="text/css">#'+sid+'{width:'+width+';}</STYLE>';
	theString += '<DIV CLASS="balloon" id="'+sid+'">'+message+'</DIV >';
	document.write(theString);
}

function makeItVisible(sid, event) {
		if (sBW == "Netscape") {
			var oid1 = document.getElementById(sid);
			oid1.left = event.pageX + 10;
		      	oid1.top = event.pageY + 10;
			oid1.visibility = "show";
		}
		else if (sBW == "Microsoft Internet Explorer") {
			var oid1 = document.all.item(sid);
			oid1.style.pixelLeft = (document.body.scrollLeft + event.clientX) + 10;
		      	oid1.style.pixelTop = (document.body.scrollTop + event.clientY) + 10;
			oid1.style.visibility = "visible";
		}
	}
	
//BAB

function fshowhide0(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById(sID);
		}

		if (otbl1.style.display == "none") {
			otbl1.style.display = "";
		}
		else if (otbl1.style.display == "") {
			otbl1.style.display = "none";
		}
	}
	
	function fshowhide(sID) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById(sID);
		}

		if (otbl1.style.display == "none") {
			otbl1.style.display = "";
		}
		else if (otbl1.style.display == "") {
			otbl1.style.display = "none";
		}
	}
		
	function fshowhide2(sID,sID2) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl1 = document.all.item(sID);
			var otbl2 = document.all.item(sID2);
		}
		else if (sBW == "Netscape") {
			var otbl1 = document.getElementById(sID);
			var otbl2 = document.getElementById(sID2);
		}
		otbl1.style.display = "";
		otbl2.style.display = "none";
	}
	
	function chngtrcolor(sID,clr1,clr2) {
		if (sBW == "Microsoft Internet Explorer") {
			var otbl = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otbl = document.getElementById(sID);
		}
		
		if (otbl.className == clr1) {
			otbl.className = clr2;
		}
		else if (otbl.className == clr2) {
			otbl.className = clr1;
		}
	}

	function chngfntclass(sID,clr1,clr2) {
		if (sBW == "Microsoft Internet Explorer") {
			var otblfnt = document.all.item(sID);
		}
		else if (sBW == "Netscape") {
			var otblfnt = document.getElementById(sID);
		}
		
		if (otblfnt.className == clr1) {
			otblfnt.className = clr2;
		}
		else if (otblfnt.className == clr2) {
			otblfnt.className = clr1;
		}
	}	
	
	function JSFX_FloatTopDiv(SID)
	{
		//Enter "frombottom" or "fromtop"
		var verticalpos="fromtop";
		if (sBW == "Microsoft Internet Explorer") 
		{
			var el = window.parent.document.all.item(SID).style;
		}
		else 
		{
			var el = window.parent.document.getElementById(SID).style;
		}

		var startX = el.left,
		startY = 0;

		function ml()
		{
			
			el.sP=function(x,y){el.left=x;el.top=y;};
			el.x = startX;
			if (verticalpos=="fromtop")
				el.y = startY;
			else
			{
					el.y = (window.parent.document.body.scrollTop + 100) + window.parent.document.body.clientHeight;
				    el.y = el.y - startY;
			}
			return el;
		}
		window.stayTopLeft=function()
		{
			if (verticalpos=="fromtop")
			{
				var pY = (window.parent.document.body.scrollTop + 100);
				ftlObj.y = ftlObj.y + (pY + startY - ftlObj.y)/8;
			}
			else
			{
					var pY = (window.parent.document.body.scrollTop + 100) + window.parent.document.body.clientHeight;
			    	ftlObj.y = ftlObj.y + (pY - startY - ftlObj.y)/8;
			}
			ftlObj.sP(ftlObj.x, ftlObj.y);
			setTimeout("stayTopLeft()", 10);
		}
		ftlObj = ml();
		stayTopLeft();
	}
	
	function closeageshipping()
{
    if ((document.getElementById("dwindow") != null) && (document.getElementById("dwindow").style.display == ''))
    {
        document.getElementById("dwindow").style.display = 'none';
    }
    if ((document.getElementById("dwindowprodind") != null) && (document.getElementById("dwindowprodind").style.display == ''))
    {
        document.getElementById("dwindowprodind").style.display = 'none';
    }
    if ((document.getElementById("dwindowtopmenu") != null) && (document.getElementById("dwindowtopmenu").style.display == ''))
    {
        document.getElementById("dwindowtopmenu").style.display = 'none';
    }
    if ((document.getElementById("dwindowleftmenus") != null) && (document.getElementById("dwindowleftmenus").style.display == ''))
    {
        document.getElementById("dwindowleftmenus").style.display = 'none';
    }
    if ((document.getElementById("dwindowaddtocart") != null) && (document.getElementById("dwindowaddtocart").style.display == ''))
    {
        document.getElementById("dwindowaddtocart").style.display = 'none';
    }
     if ((document.getElementById("dwindowleftmenuspremade") != null) && (document.getElementById("dwindowleftmenuspremade").style.display == ''))
    {
        document.getElementById("dwindowleftmenuspremade").style.display = 'none';
    }
     if ((document.getElementById("dwindowprodpreb") != null) && (document.getElementById("dwindowprodpreb").style.display == ''))
    {
        document.getElementById("dwindowprodpreb").style.display = 'none';
    }
      if ((document.getElementById("dwindowgrouppreb") != null) && (document.getElementById("dwindowgrouppreb").style.display == ''))
    {
        document.getElementById("dwindowgrouppreb").style.display = 'none';
    }
      if ((document.getElementById("dwindowgroupind") != null) && (document.getElementById("dwindowgroupind").style.display == ''))
    {
        document.getElementById("dwindowgroupind").style.display = 'none';
    }
     if ((document.getElementById("dwindowrest") != null) && (document.getElementById("dwindowrest").style.display == ''))
    {
        document.getElementById("dwindowrest").style.display = 'none';
    }
}

function fnenlargeimg(imgpath,divid)
{
 var showdivid = document.getElementById(divid);
		        if(showdivid)
		            showdivid.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" style="border-width:1px; border-color:#072963; border-style:solid;"><tr bgcolor="#072963"><td align="right" ><img src="../images/closeajaxwind.gif" style="cursor:hand" onclick="removeenlargeimg(\'' + divid + '\');" border="0" alt="close" ></td></tr><tr><td><img border=0 src="' + imgpath + '" onclick="removeenlargeimg(\'' + divid + '\');" alt="click to close" style="cursor:hand"></td></tr></table>';
	            
        

}
    function removeenlargeimg(divid)
{

var showdivid = document.getElementById(divid);
if (showdivid)
showdivid.innerHTML = "";
}

function loadwindowpreviewitem(url, width, height, tdid) {
    if (!ie5 && !ns6) {
        window.open(url, "", "width=width,height=height,scrollbars=0,resizable=0")

    }
    else {
        document.getElementById("dwindow").style.display = ''
        document.getElementById("dwindow").style.scrollbars = 0;
        document.getElementById("dwindow").style.resizable = 0;
        document.getElementById("dwindow").style.width = initialwidth = width + "px"
        document.getElementById("dwindow").style.height = initialheight = height + "px"
        document.getElementById("dwindow").style.left = document.getElementById(tdid).offsetLeft + 400;
        document.getElementById("dwindow").style.top = document.getElementById(tdid).offsetTop + 180;
        document.getElementById("cframe").src = url
    }
}
