// JavaScript Document



function imgclick( obj, id , src )
{

	//var pop =  new PopBg( document.body );
	//	pop.setDisplay( true );
	var box_class = "box_sh_ro";
	
	var loading = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class  );
	
	
	loading.midcell.style.backgroundColor = "#FFF";
	loading.midcell.style.color = "#333";		
	loading.setSize(60	, 60);
	loading.popbg.setDisplay( false );
	loading.setDisplay( true );
	loading.frame.closeButton.thebody.parentNode.removeChild(loading.frame.closeButton.thebody );
	
	var loadingimg = document.createElement("img");
		loading.appendChild( loadingimg );
		loadingimg.src = IMG_DIR+"syc_or_gr.gif";
	
	loading.setDisplay( true );

	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(800,600);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
	pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );
	//alert( pop.frame.closeButton.thebody.tagName );
	
	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
	
	
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );	
	

	
	var img = document.createElement("img");
		pop.appendChild( img );
		img.style.visibility = "hidden";
		
		img.onload = function()
		{
			pop.setSize( this.offsetWidth,this.offsetHeight );
			
			loading.hide();
			
			if( document.all )
			{
				img.style.visibility = "visible";
				pop.setDisplay( true );
			}
			else
			{
				setOpacity( pop.thebody , 0 );
				img.style.visibility = "visible";
							
				pop.setDisplay( true );
				
				var runner = new transform(
					function( intv ){
						setOpacity( pop.thebody , intv );								
					} , 
					function(){
						setOpacity( pop.thebody , 100 );
					} , 20,  100 );
				runner.run();
			}
		}
				
		img.src = "../img/photos/"+src;

}





function mImgclick( obj, index , imgs )
{
	
	//var pop =  new PopBg( document.body );
	//	pop.setDisplay( true );
	var box_class = "box_sh_ro";
	
		
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize( 600 , 600 );
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
	pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );
	//alert( pop.frame.closeButton.thebody.tagName );
	
	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
	
	
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );	
	
//======================

	var topimgs = new Array();
	
	
	var imglist = document.getElementById( imgs );
	
	//alert( imglist.innerHTML );
		imglist = imglist.getElementsByTagName(  "IMG" );

	for( var i=0; i< imglist.length; i++ )
	{	
		var file = new File(  imglist[ i ].src );
		topimgs[topimgs.length] = new Array( "../img/photos/" + file.filename + file.ext    , '','' );
		
		
	}
	
	//var imgDiv = document.getElementById("topimg");
	
	var imgDiv = document.createElement("div");
		imgDiv.style.width = "600px";
		imgDiv.style.height = "400px";
		
	
	pop.appendChild( imgDiv );

	var photo = new ImgLoader(  document.body, imgDiv, topimgs, imgDiv.offsetWidth, imgDiv.offsetHeight , 
	function( event, obj )
	{
		var top = new SlideShow2(  obj.parent, obj.thebody,  obj.imgs,  obj.width , obj.height, "#000" );
			
			top.seek( index );
			//top.start();
	} );
	
	pop.setDisplay( true );
}





function fnSetRotation(oObj, deg  )
{   
	if( document.all )
	{
		oObj.style.filter = "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')";
		
		
		var deg2radians = Math.PI * 2 / 360;
		rad = deg * deg2radians ;
		costheta = Math.cos(rad);
		sintheta = Math.sin(rad);
		
		oObj.filters.item(0).M11 = costheta;
		oObj.filters.item(0).M12 = -sintheta;
		oObj.filters.item(0).M21 = sintheta;
		oObj.filters.item(0).M22 = costheta;
	}
	else
	{
		oObj.style.MozTransform = "rotate("+ deg +"deg)";
		oObj.style.WebkitTransform = "rotate("+ deg +"deg)";
	}
}





function imgOnload( img , size , rot )
{
	var _this = this;
	var width = size;
	var height = parseInt( width*133/200 );
	
	if( document.all )  
	{
		
	}
	else
	{
		setOpacity( img , 0 );
	}
	
	img.style.visibility = "visible";
	
	//alert("Yes");
	var imgHeight = img.offsetHeight;
	var imgWidth = img.offsetWidth;
	
	if( imgWidth > width )
	{
		img.style.width = width + "px";
		img.style.height =  parseInt( width * imgHeight / imgWidth ) + "px";
	}
	
	
	imgHeight = img.offsetHeight;
	imgWidth = img.offsetWidth;
	
	if( imgHeight > height )
	{
		 img.style.height = height + "px";
		 img.style.width = parseInt( height * imgWidth / imgHeight ) + "px";
	}
	
	var topM = parseInt( ( img.parentNode.offsetHeight - img.offsetHeight  ) /2 );
	
	if( topM < 0 ) topM = 0;
	
	img.style.marginTop  =  topM +"px";
	//img.parentNode.style.paddingTop = "10px";
	
	//alert(  parseInt( ( img.parentNode.offsetHeight - img.offsetHeight  ) /2 ) +"px" );
	
	var deg = getRandomNum( 1, 3 );
	var nag = getRandomNum( 0, 1 );
	
	if( nag == 0 ) deg = 360 - deg;
	
	if( rot )  fnSetRotation( img, deg );
	
	if( document.all )
	{
		//none
	}
	else
	{
		runner = new transform( function(intv){
		
			setOpacity( img, intv );
		
		}, function(){
			
			setOpacity( img, 100);
			
			//if(  _this.parentNode   ) _this.parentNode.style.backgroundImage   = "";
			
			
		}, 20, 100);
		runner.run();
	}
	
	
}


function imgOut( img )
{
	img.style.border = "1px #000 solid";
}

function imgOver( img )
{
	img.style.border = "1px #fff solid";
}


function setclick( setid  )
{
	var pp = new PhotoPop( setid );
	
}




function subNewsetter()
{
	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  "box_sh_ro" );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize( 640,  300 );
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );
	
	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
	
	
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );	
	
	
	var title = document.createElement( "h2" );
		title.innerHTML = "订阅《每周时事》邮件";
		//title.style.padding = "10px";
		
		//pop.appendChild( title );
	
	var formT = new tableLayout( pop,  pop.midcell );
		formT.table.align = "center";
		formT.table.width= "";
		//formT.table.marginTop = "50px";
		formT.table.cellPadding = 10;

	formT.addCell( "姓名：" );
	
	var nameText = document.createElement( "input" );
		nameText.type = "text";
		nameText.className = "textbox";
		nameText.style.width = "200px";
		
		formT.addCell( nameText );
	
	formT.addRow( );
	
//===============================
	formT.addCell( "电子邮件：" );
	
	var emailText = document.createElement( "input" );
		emailText.type = "text";
		emailText.className = "textbox";
		emailText.style.width = "200px";
		
		
		formT.addCell( emailText );
	
	formT.addRow( );
	
//===============================
	formT.addCell( "城市：" );
	

	
	var thelist = document.createElement("select");
	var listCell =	formT.addCell( thelist );
		thelist.style.width = "100px";

		thelist.style.display = "";				
			
		thelist.innerHTML = "<option value='0' selected='selected' >加载中...</option>";
		thelist.disabled = true;

	var otherText = document.createElement( "input" );
		otherText.type = "text";
		otherText.style.width  = "90px";
		otherText.style.marginLeft = "10px";
		
		otherText.className = "textbox";
		
		listCell.appendChild( otherText  );
		
		//otherText.style.display = "none";
		
		thelist.onchange = function(){
		
			if( this.value == 0 )
			{
				otherText.style.display = "";				
			}
			else
			{
				otherText.style.display = "none";
			}
		}
		
		

	RPC( "../server/client.php", "getItems", false , function( msg, xmlhttp )
	{
			if( msg.status == "ok" )
			{
					thelist.innerHTML = "";
				
					var items = msg.data.getElementsByTagName('item');
					if( items.length > 0 )
					{
							
						//get cate lists
						for(var i=0; i<items.length;i++ )
						{
							var guid = getXmlText( items[i], "guid" );
							
							
						
							thelist.innerHTML += "<option id='"+ guid +"' value='"
								+( guid )+"'  >"
								+getXmlText( items[i], "title_cn" ) + "</option>";
								
							
						}
						
						
						
						thelist.disabled = false;
					}
						thelist.innerHTML += 
						"<option id='0' value='0' selected='selected' >-其他-</option>";
					thelist.disabled = false;
						
						
			}
			
	}, 9 , "" , "", "sort" , "0" , 1 );
		
		
	
	formT.addRow();
	
	formT.addCell( );
	
	var submitButton = document.createElement( "input" );
		submitButton.type = "button";
		submitButton.value = "订阅";
		
	var buttonCell = formT.addCell( submitButton );
		buttonCell.align = "right";
		
		
		submitButton.onclick = function()
		{
			this.disabled = true;
			
			if( nameText.value == "")
			{
				this.disabled = false;
				alert( "请输入您的姓名。" );
				return;
				
			}
			else if( emailText.value == "" )
			{
				this.disabled = false;
				alert( "请输入您的电子邮件。" );
				return;
				
			}
			else if( thelist.value == 0 && otherText.value  == "" )
			{
				this.disabled = false;
				alert( "请输入您的城市。" );
				return;
			}
			
				RPC( "../server/client.php", "putEmail", false , function( msg, xmlhttp )
				{
						if( msg.status == "ok" )
						{
								nameText.value = "";
								emailText.value ="";
								otherText.value  = "";
								pop.hide();	
								alert( "感谢您的订阅。" );
						}
						else
						{
							
							
						}
						
						this.disabled = false;
						
				}, nameText.value , emailText.value , thelist.value, otherText.value  );
				
			
		}
	
	
	pop.setDisplay( true );
	
	
}


function rateit(  id , rate )
{
	//alert( rate );
	
	RPC( "../server/client.php", "rateIt", false , function( msg, xmlhttp )
	{
			if( msg.status == "ok" )
			{
				
					
				alert( "感谢您的参与。" );
			}
			else
			{
				
				
			}
			
			this.disabled = false;
			
	}, id , rate );
	
}

function makeread(  id   )
{
	//alert( rate );
	
	RPC( "../server/client.php", "makeread", false , function( msg, xmlhttp )
	{
			if( msg.status == "ok" )
			{
				//alert( "感谢您的参与。" );
				//alert( "消息已读" );
				
				document.getElementById( "dot"+id ).style.display = "none";
				
			}
			else
			{
				
			}
			
			//this.disabled = false;
	}, id   );
	
}


function cityOnchange( obj )
{
		
	if( obj.value !=  0  )
	{
			
			var thelist = document.getElementById("placename");
				thelist.disabled = true;
				thelist.innerHTML = "<option id='0' value='0' selected='selected' >-"+"正在加载"+"-</option>";
								
								
				RPC( "../server/client.php", "getItems", false , function( msg, xmlhttp )
				{
						if( msg.status == "ok" )
						{
							thelist.innerHTML = "";
								var items = msg.data.getElementsByTagName('item');
								if( items.length > 0 )
								{
									thelist.innerHTML = "<option id='0' value='0' selected='selected' >-"+"所有"+"-</option>";
									//get cate lists
									for(var i=0; i<items.length;i++ )
									{
										var guid = getXmlText( items[i], "guid" );
										thelist.innerHTML += "<option  value='" +( guid )+"'  > " + getXmlText( items[i], "title_cn" )+ "</option>";
									}
									thelist.disabled = false;
								}
						}
	
				}, 3 + "" , obj.value , "", "title" , "0" , 0 );			
			
			
			
			var area = document.getElementById("area");
				area.disabled = true;
				area.innerHTML = "<option id='0' value='0' selected='selected' >-"+"正在加载"+"-</option>";
								
								
				RPC( "../server/client.php", "getItems", false , function( msg, xmlhttp )
				{
						if( msg.status == "ok" )
						{
							area.innerHTML = "";
							area.innerHTML = "<option id='all' value='all' selected='selected' >-"+"所有"+"-</option>";
				
								var items = msg.data.getElementsByTagName('item');
								if( items.length > 0 )
								{
									//get cate lists
									for(var i=0; i<items.length;i++ )
									{
										var guid = getXmlText( items[i], "guid" );
										area.innerHTML += "<option  value='" +( guid )+"'  > " + getXmlText( items[i], "title_cn" )+ "</option>";
									}
									area.disabled = false;
								}
						}
	
				}, 14 + "" , obj.value , "", "title" , "0" , 0 );					
			
			var bizarea = document.getElementById("bizarea");
				bizarea.disabled = true;
				bizarea.innerHTML = "<option id='0' value='0' selected='selected' >-"+
				"正在加载"+"-</option>";
								
								
				RPC( "../server/client.php", "getItems", false , function( msg, xmlhttp )
				{
					if( msg.status == "ok" )
					{
						bizarea.innerHTML = "";
						bizarea.innerHTML = "<option id='all' value='all' selected='selected' >-"+"所有"+"-</option>";
			
							var items = msg.data.getElementsByTagName('item');
							if( items.length > 0 )
							{
								//get cate lists
								for(var i=0; i<items.length;i++ )
								{
									var guid = getXmlText( items[i], "guid" );
									bizarea.innerHTML += "<option  value='" +
									( guid )+"'  > " + getXmlText( items[i], "title_cn" )+ 
									"</option>";
								}
								bizarea.disabled = false;
							}
					}
	
				}, 11 + "" , obj.value , "", "title" , "0" , 0 );		
			
			
			
	}
	
}




function dateOnclick(  yy, mm, dd)
{
	
	
	var yy = document.getElementById(  yy );
	var mm = document.getElementById( mm );
	var dd = document.getElementById( dd );
	
		var dp = new datePicker(  document.body , document.body, function(event, yaer, month, day ){
		
			yy.value = yaer;
			mm.value = month;
			dd.value = day;
			
		} );
		
		
		dp.show(  getLeft( yy ) ,  getTop( yy ) ,yy.value, mm.value -1, dd.value  );
	
}



function uploadImg()
{

	var box_class = "box_sh_ro";
	
	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize( 400 , 350 );
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	
//alert( pop.frame.closeButton.thebody.tagName );
	
	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
	
	
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );	
	
	var mainDiv  = document.createElement("div");
			pop.appendChild( mainDiv );
			
			mainDiv.innerHTML = '<iframe allowtransparency="1" width="400" height="350" frameborder="0" src="upload_img.php"></iframe>';
			
	
			pop.setDisplay( true );
}


var box_class = "box_sh_ro";



function pm( obj, id , theTitle )
{	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(300,300);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );

	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
		
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );
	
	
var title = document.createElement("div");
	title.innerHTML ="私人消息";
	pop.appendChild( title );
	title.style.paddingTop = title.style.paddingBottom = "10px";

var theForm = document.createElement( "form" );	
	pop.appendChild( theForm );
	theForm.method = "post";
	theForm.action = "community_index.php?com=putcomm&userid="+id+"&pm=1";
	
	if( theTitle )
	{
		theForm.action = "community_list.php?type=18&com=putcomm&userid="+id+"&pm=1";
	//community_list.php?type=18&pm=1&userid=974	
	}
	
	
var titlebox = document.createElement( "input" );	
	titlebox.type = "text";
	theForm.appendChild( titlebox );
	titlebox.className ="textbox";
	titlebox.id = "comment_title";
	titlebox.name = "comment_title";
	titlebox.display = "block";
	
	titlebox.style.width ="300px";
	titlebox.style.marginBottom = "10px";
	titlebox.maxlength="160";
	if( theTitle )
	{
		titlebox.value  = theTitle;
	}
	
var textarea = document.createElement("textarea");
	
	theForm.appendChild( textarea );
	textarea.className ="textbox";
	textarea.id = "comment_box";
	textarea.name = "comment_box";
		
	textarea.style.width ="300px";
	textarea.style.height ="200px";

var buttoDiv = document.createElement("div");
	theForm.appendChild( buttoDiv );
	buttoDiv.align = "right";
	
	var button_submit = document.createElement("input");
	button_submit.type = "button";	
	buttoDiv.appendChild( button_submit );
	button_submit.className = "textbox";
	
	button_submit.style.marginTop = "15px";
	//button_submit.style.cursor = "pointer";
	//button_submit.innerHTML = "发送";
	
	button_submit.value = "发送";
	
	button_submit.onclick = function()
	{
		var title = new String(  titlebox.value ).trim();
		var des = new String(  textarea.value ).trim();
		
			if(  title == ""  )
			{
				alert( "请输入标题" );	
				return;
			}
			else if(  des  == "" )
			{
				alert( "请输入消息内容" );	
				return;
			}
			else if( des.length > 500  )
			{
				alert( "您的字数超过"+ ( des.length - 500 ) +"个" );	
				return;
			}
			
			
			theForm.submit();
	}
	
	
	pop.setDisplay( true );
	
}



function showdes( des  , title, userid )
{
	var des = document.getElementById( des );
	

	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(300,300);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );


	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
		
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );
	
	var	text = document.createElement("div");
				text .innerHTML = des.innerHTML;
				text.style.padding = "5px";
				text.style.height ="200px";
			
				pop.appendChild( text );
	
	var	button_div = document.createElement("div");
				pop.appendChild( button_div );
	
				button_div.align = "right";
				
	var	button_reply = document.createElement("input");
				button_reply.type = "button";
				button_div.appendChild( button_reply );
				button_reply.className = "textbox";
				button_reply.value = "回复";
				
				
				button_reply.onclick = function()
				{
					
					pm(  this,  userid  ,  "回复: " +title );
					
					pop.hide();
					
				}
				
				
	
	
	pop.setDisplay( true );

	
}













function shownewplace(  )
{
	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(400,300);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );


	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
		
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );
	
	var	text = document.createElement("div");
				text.innerHTML = "<h2 align='left'>添加最新场地：</h2>";
				
				text.innerHTML += "<p>欢迎您加入In Night夜行网</p>";
				text.innerHTML += "<p>如须添加新场地请填写以下信息并发送邮件至<br />editor@in-night.com.cn<br />";
				text.innerHTML += "<br />公司名称：<br />";
				text.innerHTML += "<br />场地地址：<br />";
				text.innerHTML += "<br />场地性质及类型：<br />";
				text.innerHTML += "<br />联系人：<br />";
				text.innerHTML += "<br />联系方式：</p>";
				
				
			
		pop.appendChild( text );

	pop.setDisplay( true );

}



function shownewparty(  )
{
	
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(400,300);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );


	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
		
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );
	
	var	text = document.createElement("div");
				text .innerHTML = "<h2 align='left'>发布消息:</h2>";
				
				text.innerHTML += "<p>欢迎您加入In Night夜行网</p>";
				text.innerHTML += "<p>如有新消息发布请填写以下信息并发送邮件至<br />editor@in-night.com.cn<br />";
				text.innerHTML += "<br />活动名称：<br />";
				text.innerHTML += "<br />活动内容：<br />";
				text.innerHTML += "<br />活动时间：<br />";
				text.innerHTML += "<br />活动地点：<br />";
				text.innerHTML += "<br />主办单位：<br />";
				text.innerHTML += "<br />联系人：<br />";
				text.innerHTML += "<br />联系方式：</p>";
				
	
	pop.appendChild( text );
	
	pop.setDisplay( true );

}


function sendmsg()
{
	var	msgbox = document.getElementById( "comment_box" );

		//alert( msgbox.value.length  );

			if( msgbox.value.length > 500 )
			{
				alert(  "留言只能输入500个字您超过了" +(  msgbox.value.length  - 500 ) +"个字。" );	
				return false;
						
			}
	return true;	
}



function showHowtoGetV()
{
		
	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  box_class );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(400,300);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
pop.frame.closeButton.thebody.parentNode.removeChild(pop.frame.closeButton.thebody );	//alert( pop.frame.closeButton.thebody.tagName );


	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
		
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );
	
	var	text = document.createElement("div");
				text.innerHTML = "<h2 align='center'>怎样成为认证会员?</h2>";
				
				text.innerHTML += "<p>欢迎您加入In Night夜行网</p>";
				text.innerHTML += "<p>会员认证过程需要您配合提供以下真实信息并发送邮件至<br />editor@in-night.com.cn<br />";
				text.innerHTML += "<br />姓名：<br />";
				text.innerHTML += "<br />性别：<br />";
				text.innerHTML += "<br />职业：<br />";
				text.innerHTML += "<br />公司名称：<br />";
				text.innerHTML += "<br />担任职务：<br />";
				text.innerHTML += "<br />公司地址：<br />";
				text.innerHTML += "<br />公司电话：<br />";
				text.innerHTML += "<br />个人电话：</p>";
	
	pop.appendChild( text );
	
	pop.setDisplay( true );

	
}


function reply( name )
{
	var comment_box = document.getElementById("comment_box");
	
	comment_box.value = "回复 " + name +": \r\n";
	
	window.location = "#comm";
	
}



function imgTagToAudio()
{
	var imgTags =  document.getElementsByTagName(  "img" );
		
	for( var i =0; i<imgTags.length; i++ )
	{
		var src =   new File(  imgTags[i].src );
			
			if( src.ext.toLowerCase() == ".mp3" ) 
			{
				imgTags[i].outerHTML = '<div style=" background-color:#FFF; ">'+
															'<img src="../img/icon_mp3.png"   />'+													
															'<object type="application/x-shockwave-flash" data="../img/emff_old.swf" width="150" height="70">'+
															'<param name="movie" value="../img/emff_old.swf">'+														
															'<param name="bgcolor" value="#FFF">'+
															'<param name="FlashVars" value="src='+ imgTags[i]. src  +'&amp;autoload=yes&amp;volume=50">'+														
															'</object>'+
															'</div>';
																					
			}
		
	}
	
	
	
}


