// JavaScript Document


  ////////////////////////////////
  //        show picture        //     
  ////////////////////////////////
  function showPic(tdd,srcc,maxW,maxH)
  {
	 var picSrc = srcc
	 imgObj = new Image();
     imgObj.src = picSrc;
	
	 function showp(imgObj)
	 {   
	     var ie = String(navigator.appName)
		 if(ie=="Netscape")
		 {
			 imgObj.onload=function()
			 {
			    var inn = showPicture(imgObj,maxW,maxH)
			    tdd.innerHTML =inn 
			 }
		  } 
		  else  // IE 
		  {
		    if(imgObj.readyState!="complete")//loop the image obj
            {
		       setTimeout(function(){showp(imgObj)}, 100)
		       return false
            }
		    //prew view pic
	        tdd.innerHTML = showPicture(imgObj,maxW,maxH)   
		 }
	 }
	 showp(imgObj)
  }
  
///////////////////////////////////////////////////////////////////////
//       URL, width, height)
///////////////////////////////////////////////////////////////////////
function showImgs(theURL,maxWidth,maxHeight)
{
   var imgObj;
   var width,height;
   var max_k = parseFloat(maxWidth/maxHeight)
   var k; 
   imgObj = new Image();
   imgObj.src = theURL;
   
  
      if(typeof(imgObj) == 'object')
      {
              if ((imgObj.width != 0) && (imgObj.height != 0))
              {
						   width=imgObj.width;
                            height=imgObj.height;
                            k=parseFloat(width/height);
                           // document.write (k); 
                             if(k>=max_k)
							 {
                               if (width>=maxWidth)
							   {
                                  width=maxWidth;
                                  height=width/k;
                                 
                                }
							 }
                             else         
                             {
							    if (height>=maxHeight)
							    {
                                  height=maxHeight;
                                  width=k*height;
                                 }
                              }
							 //back
							 return '<img src="'+theURL+'" width='+width+' height='+height+' border=0 >'
               }
               else
                  setTimeout(function(){showImgs(theURL,maxWidth,maxHeight)}, 100)
		
      }
   
  
}

 ////////////////////////////////////////////////////////////////////
 //         (obj, width, height)           //
 ///////////////////////////////////////////////////////////////////
function showPicture(imgObj,maxWidth,maxHeight)
{
       var width,height;
	   var max_k = parseFloat(maxWidth/maxHeight)
       var k; 
  
      if(typeof(imgObj) == 'object')
      {
              if ((imgObj.width != 0) && (imgObj.height != 0))
              {
						   width=imgObj.width;
                            height=imgObj.height;
                            k=parseFloat(width/height);
                           // document.write (k); 
                             if(k>=max_k)
							 {
                               if (width>=maxWidth)
							   {
                                  width=maxWidth;
                                  height=width/k;
                                }
							 }
                             else         
                             {
							    if (height>=maxHeight)
							    {
                                  height=maxHeight;
                                  width=k*height;
                                 }
                              }
							 //back
							 return '<img src="'+imgObj.src+'" width='+width+' height='+height+' border=0 >'
               }
               else
                  setTimeout(function(){showPicture(imgObj,maxWidth,maxHeight)}, 100)
      }
}
  

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
////2006-5-10
////modify this size of image
  function formatImg(comment)
  {
     var imgs = comment.match(/<img([^>]){1,300}>/g)  //Back a array thia contai all image,<img....>is image lable
	 var maxWidth = 470
	 if(imgs!=null)
	 for(var i=0;i<imgs.length;i++)
	 {
	    var imgsTemp = imgs[i]  //one <img...> lable
	    var width1 = String(imgs[i].match(/(WIDTH:\s{0,10}\d+px)/g))
		var width2 = String(imgs[i].match(/(width="\d+")/g))
	    if(width1!="null" || width2!="null")
	    {
		   if(width1!="null")
		   {
	          var dd = width1.match(/\d+/)
	          if(parseInt(dd)>maxWidth)
		         imgsTemp = imgsTemp.replace(width1,"width:"+maxWidth+"px")
	       }
		   if(width2!="null")
		   {
	          var dd = width2.match(/\d+/)
	          if(parseInt(dd)>maxWidth)
		         imgsTemp = imgsTemp.replace(width2,"width=\""+maxWidth+"\"")
		   }
	    }
		else
		{
		   var srcStr = imgs[i].match(/src="(\S|\s){1,300}"/)
		   var srcArr = String(srcStr).split("\"")
		   var imgObj = new Image()
		   imgObj.src = srcArr[1]
		   if(typeof(imgObj)=="object")
		   {
		      if(imgObj.width!=0 && imgObj.height!=0)
              {
				   var width = imgObj.width;
                   var height = imgObj.height;
                   k = width/height;
                           
                   if (width>=maxWidth)
				   {
                       width=maxWidth;
                       height=parseInt(width/k);
                   }
				   var str = "<img style=\"width:"+width+"px; height:"+height+"px\""
				   //alert(imgsTemp)
				   imgsTemp = imgsTemp.replace("<img",str)
				   //alert(imgsTemp)
               }
		   }
		}
		comment = comment.replace(String(imgs[i]),imgsTemp)
	 }
	 return comment
  }
  /////End formatImg()
  
   //////////////////////////////////////
   //      show products                   //
   //////////////////////////////////////
                  function showProuct(kind,tid)
				   {
				      var str = ' <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="Arial14">'
					  if(kind!=5)
					  {
					     //Product's string to Array
						 if(String(opener.document.all.productIdStr.value)=="")
						 {
						     str = ""
							 eval(tid+".innerHTML = str")
						     return
						 }
				         var pId_arr = String(opener.document.all.productIdStr.value).split("^")
				         var pName_arr = String(opener.document.all.productNameStr.value).split("^")
					     var count_arr = String(opener.document.all.countStr.value).split("^")
					     var subtotal_arr = String(opener.document.all.subtotalStr.value).split("^")
						 var units = String(opener.document.all.units.value)
					  }
					  var total = parseFloat(opener.document.all.total.value)
					  
				      //Show products list
					  if(kind==1)
			             for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
                            if(parseInt(pId_arr[i])==0)
                               str += ' <td height="22">&nbsp;<input type="text" class="transparentText" size="18" onFocus="this.className=\'notran\'" onBlur="this.className=\'transparentText\'" value="'+pName_arr[i]+'">&nbsp;</td>'
                            else
							   str += ' <td height="22">&nbsp;'+pName_arr[i]+'&nbsp;</td>'
                            str += ' <td width="15%"><img src="../image/icon/drop.gif" border="0" style="cursor:pointer" onClick="drop('+i+')"></td>'
                            str += '</tr>'  
				         }
					  else if(kind==2)
					     for(var i=0;i<pId_arr.length;i++)
				         {
						    var uniPrice = parseFloat(subtotal_arr[i])/parseFloat(count_arr[i])
				            str += '<tr>'
							str += ' <td width="20%">&nbsp;'+units+'</td>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(uniPrice,2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
					  else if(kind==3)
					     for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
                            str += ' <td height="22" align="center"><input type="text" class="input" onBlur="changeQuantity(this,'+i+')" style="text-align:center" size="5"  value="'+count_arr[i]+'"></td>'
                            str += '</tr>'  
				         }	 
					   else if(kind==4)
					     for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
							str += ' <td width="20%">&nbsp;'+units+'</td>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(subtotal_arr[i],2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
					   else if(kind==5)
				         {
				            str += '<tr>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(total,2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
						 
					  str += '</table>'
					  eval(tid+".innerHTML = str")
				   }
	///////////////////
	function addProducts(id,name,quantity,amount,storage)
	{  
	    //alert(opener.document.all.total.value)
	    if(String(opener.document.all.productIdStr.value)!="")
		{
	       var pId_arr = String(opener.document.all.productIdStr.value).split("^")
		   //limited product count
		   if(pId_arr.length<11)
		   {
		     // var addtoTotal = 0
			  var hasSame = false
			  var overStorage = false
		      var pName_arr = String(opener.document.all.productNameStr.value).split("^")
		      var count_arr = String(opener.document.all.countStr.value).split("^")
		      var subtotal_arr = String(opener.document.all.subtotalStr.value).split("^")
			  var storage_arr = String(opener.document.all.StorageStr.value).split("^")
			  for(var i=0;i<pId_arr.length;i++)
			  {
			     if(parseInt(id)==parseInt(pId_arr[i]) && parseInt(id)!=0)
				 {
				     var oneprice = parseFloat(subtotal_arr[i])/parseFloat(count_arr[i])
				    count_arr[i] = String(parseInt(count_arr[i])+1)
					subtotal_arr[i] = String(parseFloat(subtotal_arr[i])+oneprice)
					//addtoTotal = oneprice
					hasSame = true
					if(parseInt(count_arr[i])>parseInt(storage))
					{
					   overStorage = true
					   alert("It's out of storage")
					}
				 }
			  }
			  
			  if(!hasSame)
			  {
			      pId_arr.push(String(id))
				  pName_arr.push(name)
				  count_arr.push(String(quantity))
				  subtotal_arr.push(String(amount))
				  storage_arr.push(String(storage))
			  }
			  if(!overStorage)  
			  {
			     opener.document.all.productIdStr.value = String(pId_arr).replace(/\,/g,"^")
			     opener.document.all.productNameStr.value = String(pName_arr).replace(/\,/g,"^")
			     opener.document.all.countStr.value = String(count_arr).replace(/\,/g,"^")
			     opener.document.all.subtotalStr.value = String(subtotal_arr).replace(/\,/g,"^")
				 opener.document.all.StorageStr.value = String(storage_arr).replace(/\,/g,"^")
		         opener.document.all.total.value = cheng(parseFloat(opener.document.all.total.value)+parseFloat(amount),2) //+addtoTotal
			  }
		   }
		   else
		   {
		      opener.document.all.addButton.style.display = "none"
			  opener.document.all.addOPd.style.display = "none"
			  window.close()
		   }
		}
		else
		{
		   opener.document.all.productIdStr.value = id
		   opener.document.all.productNameStr.value = name
		   opener.document.all.countStr.value = quantity
		   opener.document.all.subtotalStr.value = amount
		   opener.document.all.StorageStr.value = storage
		   opener.document.all.total.value = cheng(parseFloat(amount)+parseFloat(opener.document.all.postage.value),2)
		}
		 
		
		var astr = "opener.document.all."
	    showProuct(1,astr+"products")
		showProuct(2,astr+"unitprice")
		showProuct(3,astr+"quantity")
		showProuct(4,astr+"amount")
		showProuct(5,astr+"totals")
	}
	
	////////////////////
	function showProductT(kind,tid)
				   {
				      var str = ' <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="Arial14">'
					  if(kind!=5)
					  {
					     //Products's string to Array
						 if(String(parent.document.all.productIdStr.value)=="")
						 {
						     str = ""
							 eval(tid+".innerHTML = str")
						     return
						 }
				         var pId_arr = String(parent.document.all.productIdStr.value).split("^")
				         var pName_arr = String(parent.document.all.productNameStr.value).split("^")
					     var count_arr = String(parent.document.all.countStr.value).split("^")
					     var subtotal_arr = String(parent.document.all.subtotalStr.value).split("^")
						 var units = String(parent.document.all.units.value)
					  }
					  var total = parseFloat(parent.document.all.total.value)
					  
				      //Show products list
					  if(kind==1)
			             for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
							
                            if(parseInt(pId_arr[i])==0)
                               str += ' <td height="22">&nbsp;<input type="text" class="transparentText" size="18" onFocus="this.className=\'notran\'" onBlur="this.className=\'transparentText\'" value="'+pName_arr[i]+'">&nbsp;</td>'
                            else
							   str += ' <td height="22">&nbsp;'+pName_arr[i]+'&nbsp;</td>'
                            str += ' <td width="15%"><img src="../image/icon/drop.gif" border="0" style="cursor:pointer" onClick="drop('+i+')"></td>'
                            str += '</tr>'  
				         }
					  else if(kind==2)
					     for(var i=0;i<pId_arr.length;i++)
				         {
						    var uniPrice = parseFloat(subtotal_arr[i])/parseFloat(count_arr[i])
				            str += '<tr>'
							str += ' <td width="20%">&nbsp;'+units+'</td>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(uniPrice,2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
					  else if(kind==3)
					     for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
                            str += ' <td height="22" align="center"><input type="text" class="input" onBlur="changeQuantity(this,'+i+')" style="text-align:center" size="5"  value="'+count_arr[i]+'"></td>'
                            str += '</tr>'  
				         }	 
					   else if(kind==4)
					     for(var i=0;i<pId_arr.length;i++)
				         {
				            str += '<tr>'
							str += ' <td width="20%">&nbsp;'+units+'</td>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(subtotal_arr[i],2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
					   else if(kind==5)
				         {
				            str += '<tr>'
                            str += ' <td height="22" align="right">&nbsp;'+cheng(total,2)+'&nbsp;</td>'
                            str += '</tr>'  
				         }
						 
					  str += '</table>'
					  eval(tid+".innerHTML = str")
				   }
	///////////////////
	//   Add product to list  Parent
	/////////////////
	function addProductsT(id,name,quantity,amount)
	{  
	    //alert(parent.document.all.total.value)
	    if(String(parent.document.all.productIdStr.value)!="")
		{
	       var pId_arr = String(parent.document.all.productIdStr.value).split("^")
		   //limited add product
		   if(pId_arr.length<11)
		   {
		     // var addtoTotal = 0
			  var hasSame = false
		      var pName_arr = String(parent.document.all.productNameStr.value).split("^")
		      var count_arr = String(parent.document.all.countStr.value).split("^")
		      var subtotal_arr = String(parent.document.all.subtotalStr.value).split("^")
			  for(var i=0;i<pId_arr.length;i++)
			  {
			     if(parseInt(id)==parseInt(pId_arr[i]) && parseInt(id)!=0)
				 {
				     var oneprice = parseFloat(subtotal_arr[i])/parseFloat(count_arr[i])
				    count_arr[i] = String(parseInt(count_arr[i])+1)
					subtotal_arr[i] = String(parseFloat(subtotal_arr[i])+oneprice)
					//addtoTotal = oneprice
					hasSame = true
				 }
			  }
			  
			  if(!hasSame)
			  {
			      pId_arr.push(String(id))
				  pName_arr.push(name)
				  count_arr.push(String(quantity))
				  subtotal_arr.push(String(amount))
			  }
			  
			  parent.document.all.productIdStr.value = String(pId_arr).replace(/\,/g,"^")
			  parent.document.all.productNameStr.value = String(pName_arr).replace(/\,/g,"^")
			  parent.document.all.countStr.value = String(count_arr).replace(/\,/g,"^")
			  parent.document.all.subtotalStr.value = String(subtotal_arr).replace(/\,/g,"^")
		      parent.document.all.total.value = cheng(parseFloat(parent.document.all.total.value)+parseFloat(amount),2) //+addtoTotal
		   }
		   else
		   {
		      parent.document.all.addButton.style.display = "none"
			  parent.document.all.addOPd.style.display = "none"
			  window.close()
		   }
		}
		else
		{
		   parent.document.all.productIdStr.value = id
		   parent.document.all.productNameStr.value = name
		   parent.document.all.countStr.value = quantity
		   parent.document.all.subtotalStr.value = amount
		   parent.document.all.total.value = cheng(parseFloat(amount)+parseFloat(parent.document.all.postage.value),2)
		}
		 
		
		var astr = "parent.document.all."
	    showProductT(1,astr+"products")
		showProductT(2,astr+"unitprice")
		showProductT(3,astr+"quantity")
		showProductT(4,astr+"amount")
		showProductT(5,astr+"totals")
	}
	
	///////////////////
	//   Show watting...
	/////////////////
	function waitings(words)
	{
		var tops = eval(top.document.body.clientHeight/2-50)
		var lefts = eval(top.document.body.clientWidth/2-150)
		
		document.write('<div align="left" id="updatecontent"  style="position:absolute ; z-index:2000; top:'+tops+'px; left:'+lefts+'px ">'
					   +'<table border="0" width="300" cellpadding="0" cellspacing="1" bgcolor="#999999" class="aFilter"><tr><td bgcolor="#E8E8E8"  height="100" align="center">'
					   +'<font size=3>'+words+'</font></td></tr></table>'
					   +'</div>')
		
	}
	
	////////////////////////////
	//   show eidt table       //
	////////////////////////////
	//    td_obj  table  fields  IDid  static  smallbox  Replace  Font
	//////////////////////////
	function showEdit(td_obj,tables,fields,ID,static,smallbox,Replaces,Fonts,inputType,backFuns)
	{
		var td_Node = document.getElementById(td_obj)
		var contents = unescape(td_Node.getAttribute("Contents"))
		var conte = contents.length
		var heights = ""
		if(conte>200)
		  heights = "height:60px;"
		if(conte>400)
		  heights = "height:100px;"
		if(conte>600)
		  heights = "height:160px;"
		if(conte>800)
		  heights = "height:200px;"
		if(conte>1000)
		  heights = "height:300px;"
		 if(String(static)!="undefined")
		   var str = '&nbsp;<div style="position:absolute "><table  border="0" cellspacing="0" cellpadding="0" width="100%">'
		 else
		   var str = '<div style="position:static "><table  border="0" cellspacing="0" cellpadding="0" width="100%">'
                        str += '<tr>'
		  
          
		  if(String(inputType)!="undefined")
		  {
			  switch(String(inputType))
			  {
				  case "password" : 
				     str += '<td><input name="'+tables+'_'+ID+'" type="password" style="width:90%;'+heights+'background-color:#FFFFCC; border:1px solid #000000; font-size:12px; line-height:11px" value="'+contents+'"></td>'; break;
				  default : 
				     str += '<td>'+unescape(inputType)+'</td>'; 
			  }
		  }
		  else
		  { 
			   if(String(smallbox)!="undefined")  ///small input
		          str += '<td><input name="'+tables+'_'+ID+'" style="width:90%;'+heights+'background-color:#FFFFCC; border:1px solid #000000; font-size:12px; line-height:11px" onBlur="javascript:if(confirm(\'Are you sure to Save£¿\'))saveEdit(\''+escape(contents)+'\',\''+tables+'\',\''+fields+'\','+ID+',\''+td_obj+'\',\''+Replaces+'\',\''+Fonts+'\');else cancelEdit(\''+td_obj+'\'); " value="'+contents+'"></td>'
		      else                              //big input
                  str += '<td><textarea name="'+tables+'_'+ID+'" style="width:98%;'+heights+'background-color:#FFFFCC; border:1px solid #000000; font-size:12px; line-height:11px">'+contents+'</textarea></td>'
		  }
		  
					   str += '</tr>'
					   if(String(smallbox)=="undefined")
					   {
                          str += ' <tr>'
                          str += ' <td><input type="button" name="Submit" value=" Save " style="border:1px solid #000000; width:50px" onClick="saveEdit(\''+escape(contents)+'\',\''+tables+'\',\''+fields+'\','+ID+',\''+td_obj+'\',\''+Replaces+'\',\''+Fonts+'\')">'
                          str += '<input type="button" name="Submit" value="Cancel" style="border:1px solid #000000; width:50px" onClick="cancelEdit(\''+td_obj+'\')">'
					   
						   str += '&nbsp;&nbsp;<font id="loading_'+tables+'_'+ID+'" color=red></font></td>'
                           str += '</tr>'
					   }
                      str += '</table></div>' 
		//td_obj.style.visibility = "visible"
		//document.getElementById(this_obj).style.display = "none"
		//document.getElementById(td_obj).style.display = ""
		var td = document.createElement("td")
		var parent_Node = td_Node.parentNode     //get father node<tr>
		var new_td = parent_Node.insertBefore(td,td_Node)   //insert new node<td>
		new_td.innerHTML = str
		td_Node.style.display = "none"
		
		document.getElementById(tables+'_'+ID).focus()
		document.getElementById(tables+'_'+ID).select()
		
		var dd = backFuns
	}
	
	//Cancel button
	function cancelEdit(td_obj)
	{
		var td_Node = document.getElementById(td_obj)
		var parent_Node = td_Node.parentNode     //get father node<tr>
		parent_Node.removeChild(td_Node.previousSibling)
		td_Node.style.display = ""
	}
	
	//Save button
	function saveEdit(oldContent,tables,fields,id, td_obj,Replaces,Fonts) 
	{
		var td_Node = document.getElementById(td_obj)
		//document.getElementById("loading_"+tables+"_"+id).innerHTML='Lading...'
		var contents = String(document.getElementById(tables+"_"+id).value)
		if(String(oldContent)!=contents)
		{
		   contents = escape(contents.replace(/\'/g,"`"))
		   fields = escape(fields)
		   
		   var ss = "Operation.asp?tables="+tables+"&fields="+fields+"&ID="+id+"&contents="+contents
		 
		   var mAjx = new Ajax(ss)
		  // var results = String(mAjx.result).replace(/\n/g,"<br>").replace(/\s\s/g, "¡¡").replace(/\`/g,"'")
		   var results = mAjx.result
		  // alert(String(results))
		  // td_Node.innerHTML = results 
		  
		  //Save to Contents
		   td_Node.setAttribute('Contents',contents)
		   
		   var innerContents = ""
		  // if(String(Replaces)!="undefined")  ; //
		    // innerContents = eval('unescape(contents)'+unescape(Replaces))
		  // else
		     innerContents = unescape(contents)
			 
		   if(String(Fonts)!="undefined")
		   {
			  var font_arr =  unescape(Fonts).split("##")
		      innerContents = font_arr[0]+innerContents+font_arr[1]
		   }
		   
		   ///return
		   td_Node.innerHTML = innerContents
		}
		//document.getElementById("loading_"+tables+"_"+id).innerHTML=''
		var parent_Node = td_Node.parentNode     //get Father node<tr>
		parent_Node.removeChild(td_Node.previousSibling)
		td_Node.style.display = ""
		
	}
	
	
	function showEdit2(td_obj,ID)
	{
		var td_Node = document.getElementById(td_obj)
		td_Node.innerHTML = '<iframe src="Editers.asp?bcID='+ID+'" name="showList" width="100%" height="900" scrolling="no" frameborder="0" id="showList"> </iframe>'
	   
	    var parent_Node = td_Node.parentNode     //get father node<tr>
		var new_td = parent_Node.insertCell(1)   //insert new node<td>
		new_td.innerHTML = str
		td_Node.style.display = "none"
	}
	
	/////////////////////////////
	//        Alert Menu       //
	/////////////////////////////
	function popAlert(mes)
    {
        var sels = document.getElementsByTagName("select")
		for(i=0;i<sels.length;i++)
		   sels[i].style.display = "none"
		   
        var dv = top.document.createElement("div")
	    dv.style.position = "absolute"
		dv.style.top = 0
		dv.style.left = 0
		dv.style.backgroundColor = "#CCCCCC"
		dv.style.width = top.document.body.clientWidth
		dv.style.height = top.screen.availHeight
		dv.style.filter = "alpha(opacity=50)"
		
		var dv_menu = top.document.createElement("div")
		dv_menu.style.position = "absolute"
		dv_menu.style.top = 300
		dv_menu.style.left = top.document.body.clientWidth*0.5-100
		dv_menu.style.backgroundColor = "#FFFFFF"
		dv_menu.style.width = 300
		dv_menu.style.height = 100
		dv_menu.style.border = "1px solid #333333"
		dv_menu.style.filter = "progid:DXImageTransform.Microsoft.Shadow(color=#666666,Strength=8,Direction=135)"
		dv_menu.style.padding = "30px 0px 0px 0px"
		dv_menu.style.font = "15px Arial;"
		dv_menu.innerHTML = mes+"<br><br><img src='images/waiting.gif'>"
		
		var dvs = top.document.createElement("div")
		dvs.id = "dv_alert"
		dvs.appendChild(dv)
		dvs.appendChild(dv_menu)
		top.document.body.appendChild(dvs)
   }

	
	