﻿var div;
  
  function pmwinmusic(width,height,url) {
  if(document.getElementById('pmlayer')!=null)
  {
  document.body.removeChild(div);
  }
		var clientWidth = document.body.clientWidth;
		var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		var pmwidth = width;
		var pmheight = height;
			div = document.createElement('div');div.id = 'pmlayer';
			div.style.width = pmwidth + 'px';
			div.style.height = pmheight + 'px';
			div.style.left = ((clientWidth - pmwidth) / 2) + 'px';
			div.style.position = 'absolute';
			div.style.zIndex = '999';
			document.body.appendChild(div);
			 var retstr='';
             retstr=retstr+'<div id="divshowdiv" style="position:absolute; width:'+width +'px; left: 3px; top: 24px; background: #FFFFFF;" >';   
             retstr=retstr+'<div style="width: '+width +'px; background: #666666; margin: 5px auto; text-align: left">';      
           retstr=retstr+'<div style="width: '+width +'px; height: 100%; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px">';  
 retstr=retstr+'<a href="/user/usermusic.aspx"><span style="position:absolute; right:20px; top:10px; cursor:hand; color:White;">关闭</span></a>';     
             retstr=retstr+'<EMBED loop="-1" src="'+url+'" width='+width +'px height='+height +'px type=audio/x-pn-realaudio-plugin mime-types="mime.types" Initfn="load-types" controls="ControlPanel,StatusBar,TACCtrl" maintainaspect="true" loop="false" autostart="true"> ';       
              retstr=retstr+'</div>';      
            retstr=retstr+'</div>';       
           retstr=retstr+'</div>'; 
			document.getElementById('pmlayer').innerHTML = retstr;
		document.getElementById('pmlayer').style.display = '';
		document.getElementById('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';
		
}
  
  function pmwin(width,height,url) {

 if(document.getElementById('pmlayer')!=null)
  {
  document.body.removeChild(div);
  }
		var clientWidth = document.body.clientWidth;
		var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		var pmwidth = width;
		var pmheight = height;
			div = document.createElement('div');div.id = 'pmlayer';
			div.style.width = pmwidth + 'px';
			div.style.height = pmheight + 'px';
			div.style.left = ((clientWidth - pmwidth) / 2) + 'px';
			div.style.position = 'absolute';
			div.style.zIndex = '999';
			document.body.appendChild(div);
			 var retstr='';
             retstr=retstr+'<div id="divshowdiv" style="position:absolute; width:'+width +'px; left: 3px; top: 24px; background: #FFFFFF;" >';   
             retstr=retstr+'<div style="width: '+width +'px; background: #666666; margin: 5px auto; text-align: left">';      
           retstr=retstr+'<div style="width: '+width +'px; height: 100%; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px">';  
 retstr=retstr+'<a href="###" onclick="document.body.removeChild(div);"><span style="position:absolute; right:20px; top:10px; cursor:hand;">关闭</span></a>';     
             retstr=retstr+'<iframe id="ifroamdiv" src="'+url+'" width=" '+width +'" height=" '+height +'" frameborder="0"></iframe>';       
              retstr=retstr+'</div>';      
            retstr=retstr+'</div>';       
           retstr=retstr+'</div>'; 
			document.getElementById('pmlayer').innerHTML = retstr;
		document.getElementById('pmlayer').style.display = '';
		document.getElementById('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';
		
}
  function pmwin1(width,height,url) {
 
		var clientWidth = document.body.clientWidth;
		var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		var pmwidth = width;
		var pmheight = height;
			div = document.createElement('div');div.id = 'pmlayer';
			div.style.width = pmwidth + 'px';
			div.style.height = pmheight + 'px';
			div.style.left = ((clientWidth - pmwidth) / 2) + 'px';
			div.style.position = 'absolute';
			div.style.zIndex = '999';
			document.body.appendChild(div);
			 var retstr='';
             retstr=retstr+'<div id="divshowdiv" style="position:absolute; width:'+width +'px; left: 3px; top: 24px; background: #FFFFFF;" >';   
             retstr=retstr+'<div style="width: '+width +'px; background: #666666; margin: 5px auto; text-align: left">';      
           retstr=retstr+'<div style="width: '+width +'px; height: 100%; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px">'; 
            
             retstr=retstr+'<input type="button"  value=" 确 定 " onclick="tovalue(\'txttjren\',\'txtid\')" style="position:absolute; right:20%; top:500px; cursor:hand; width:100px" class="button_1"/>';
              retstr=retstr+'<a href="###" onclick="document.body.removeChild(div);"><span style="position:absolute; right:20px; top:10px; cursor:hand;">关闭</span></a>';     
             retstr=retstr+'<iframe id="ifroamdiv" src="'+url+'" width=" '+width +'" height=" '+height +'" frameborder="0"></iframe>';       
              retstr=retstr+'</div>';      
            retstr=retstr+'</div>';       
           retstr=retstr+'</div>'; 
			document.getElementById('pmlayer').innerHTML = retstr;
		document.getElementById('pmlayer').style.display = '';
		document.getElementById('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';
		
}
 function tovalue(txt1,txt2)
 {
 var txttjren=document.getElementById(txt1);
 var id=window.frames['ifroamdiv'].document.getElementById(txt2).value
 if(id!='')
 {
 txttjren.value=id;
 }
 document.body.removeChild(div);
 txttjren.focus();
 }