// JavaScript Document
self.moveTo(0,0) 
self.resizeTo(screen.availWidth,screen.availHeight)
function CheckForm()
	{
		if(document.UserLogin.UserName.value=="")
		{
			alert("请输入用户名！");
			document.UserLogin.UserName.focus();
			return 0;
		}
		if(document.UserLogin.Password.value == "")
		{
			alert("请输入密码！");
			document.UserLogin.Password.focus();
			return 0;
		}
	}
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#000000\" style=\"border: 1px solid #D4D4D4;\">");
document.writeln("<form action=\'http:\/\/www.sm114.com.cn\/Users\/CheckLogin.asp\' method=\'post\' name=\'UserLogin\' onSubmit=\'return CheckForm();\'>");
document.writeln("<tr bgColor=\"#f4f4f4\">");
document.writeln("<td width=\"326\">&nbsp;&nbsp;用户名：");
document.writeln("  <input name=\'MemName\' type=\'text\' id=\'MemName\' style=\"background-image:url(\/Templets\/images\/search_inputbackground.gif); padding:0px; border: 1px solid #aaa; height: 18px; width: 100px;\"\/> 密码：<input name=\'Password\' type=\'password\' id=\'Password\' style=\"background-image:url(\/Templets\/images\/search_inputbackground.gif); padding:0px; border: 1px solid #aaa; height: 18px; width: 100px;\" \/><\/td>");
document.writeln("<td width=\"54\"><input name=\'Login\' id=\'Login\'  type=\"image\" src=\"http:\/\/www.sm114.com.cn\/Templets\/Images\/dr.gif\" align=\"middle\" \/><\/td>");
document.writeln("<td width=\"378\"><a href=\"http:\/\/www.sm114.com.cn\/Users\/Register.asp\" target=\"_blank\">免费注册<\/a> | <a href=\"http:\/\/www.sm114.com.cn\/Users\/User_GetPassword.asp\" target=\"_blank\">忘记密码<\/a><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/form>");
document.writeln("<\/table>");
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("  <tr>");
document.writeln("    <td height=\"3\"><\/td>");
document.writeln("  <\/tr>");
document.writeln("<\/table>");
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("  <tr>");
document.writeln("    <td width=\"198\" height=\"62\"><img src=\"http:\/\/www.sm114.com.cn\/Templets\/Images\/logo.png\" alt=\"媒介搜索第一网logo\" width=\"198\" height=\"62\"><\/td>");
document.writeln("    <td width=\"562\" style=\"border: 1px solid #CCCCCC;\"><table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"nav01\">");
document.writeln("      <tr>");
document.writeln("        <td height=\"20\" align=\"center\" bgcolor=\"#F9F9F9\">  <a href=\"http:\/\/www.sm114.com.cn\/index.html\"><font color=\"#70B1CD\"><strong>首　　页<\/strong><\/font><\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/mtindex\/index.htm\"><font color=\"#214293\"><strong>媒体资讯<\/strong><\/font><\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/adlom\/Index.htm\">广告公司<\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/mtnews\/index.htm\"><font color=\"#BDDB91\"><strong>媒体专题<\/strong><\/font><\/a> | <a href=\"http:\/\/www.sm114.com.cn\/webto\/index.htm\">网页目录<\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/dalar\/Indexv.htm\"><font color=\"#52B9FE\"><strong>航空优势媒体<\/strong><\/font><\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/hkmt_index\/Index.html\"><font color=\"#BDE8FD\"><strong>航空媒体<\/strong><\/font><\/a><\/td>");
document.writeln("      <\/tr>");
document.writeln("      <tr>");
document.writeln("          <td height=\"20\" align=\"center\" bgcolor=\"#EEEEEE\"><a href=\"http:\/\/www.sm114.com.cn\/s\/hy_index\/Index.htm\"><font color=\"#990000\">户外媒体<\/font><\/a> ");
document.writeln("            | <a href=\"http:\/\/www.sm114.com.cn\/s\/tv_index\/Index.htm\">电视媒体<\/a> ");
document.writeln("            | <a href=\"http:\/\/www.sm114.com.cn\/s\/cnbz_index\/Index.htm\">报纸媒体<\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/zz_index\/Index.htm\">杂志媒体<\/a> ");
document.writeln("            | <a href=\"http:\/\/www.sm114.com.cn\/s\/gb_index\/Index.htm\">广播媒体<\/a> | <a href=\"http:\/\/www.sm114.com.cn\/s\/web_index\/Index.htm\">网络媒体<\/a> ");
//document.writeln("            | <a href=\"#\">DM 直 投<\/a> <\/td>");
document.writeln("            | <a href=\"http:\/\/www.cm114.com.cn\"><font color=\"#FF0000\"><strong>媒企通<\/strong><\/font><\/a> <\/td>");
document.writeln("      <\/tr>");
document.writeln("      <tr>");
document.writeln("          <td height=\"20\" align=\"center\" bgcolor=\"#F9F9F9\">  ");
document.writeln("          <\/td>");
document.writeln("      <\/tr>");
document.writeln("    <\/table><\/td>");
document.writeln("  <\/tr>");
document.writeln("<\/table>");
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("  <tr>");
document.writeln("    <td height=\"2\"><\/td>");
document.writeln("  <\/tr>");
document.writeln("<\/table>");
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#E4E4E4\">");
document.writeln("  <tr>");
document.writeln("    <td align=\"center\" bgcolor=\"#EFEFEF\">地方站　· <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/beijing.html\" target=\"_blank\"><font color=\"#990000\">北京<\/font><\/a> ");
document.writeln("      ·<a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/shanghai.html\" target=\"_blank\"><font color=\"#990000\">上海<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/guangzhou.html\" target=\"_blank\"><font color=\"#990000\">广州<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/xian.html\" target=\"_blank\"><font color=\"#990000\">西安<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/nanjing.html\" target=\"_blank\"><font color=\"#990000\">南京<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/zhenzhou.html\" target=\"_blank\"><font color=\"#990000\">郑州<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/chengdu.html\" target=\"_blank\"><font color=\"#990000\">成都<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/lanzhou.html\" target=\"_blank\"><font color=\"#990000\">兰州<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/hangzhou.html\" target=\"_blank\"><font color=\"#990000\">杭州<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/hefei.html\" target=\"_blank\"><font color=\"#990000\">合肥<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/shenzhen.html\" target=\"_blank\"><font color=\"#990000\">深圳<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/jinan.html\" target=\"_blank\"><font color=\"#990000\">济南<\/font><\/a> ");
document.writeln("      · <a href=\"http:\/\/www.sm114.com.cn\/s\/difang\/zhongqin.html\" target=\"_blank\"><font color=\"#990000\">重庆<\/font><\/a> ");
document.writeln("  <\/tr>");
document.writeln("<\/table>");
document.writeln("<table width=\"760\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("  <tr>");
document.writeln("    <td height=\"5\"><\/td>");
document.writeln("  <\/tr>");
document.writeln("<\/table>")
function checkForm(f) {
    if(f.lx_qqmsn.value==""){
        alert("请输入您联系方式，谢谢!");
        f.lx_qqmsn.focus();
        return false
    }
    if(f.ly_name.value==""){
        alert("请输入您名称，谢谢!")
        f.ly_name.focus();
        return false
    }
	if(f.VerifyCode.value==""){
        alert("请输入验正码，谢谢!")
        f.VerifyCode.focus();
        return false
    }
	if(f.ly_count.value==""){
        alert("请输入留言内容，谢谢!")
        f.ly_count.focus();
        return false
    }
}// JavaScript Document
//***********************订阅开始*********************************
function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID) : document.all[aID];
}

function getParentElement(elm)
{
	return (elm.parentElement) ? elm.parentElement : elm.parentNode
}
var Drag={
        "obj":null,
	"init":function(a, aRoot){
			a.onmousedown=Drag.start;
			a.root = aRoot;
			if(isNaN(parseInt(a.root.style.left)))a.root.style.left="0px";
			if(isNaN(parseInt(a.root.style.top)))a.root.style.top="0px";
			a.root.onDragStart=new Function();
			a.root.onDragEnd=new Function();
			a.root.onDrag=new Function();
		},
	"start":function(a){	
			var b=Drag.obj=this;
			a=Drag.fixE(a);
			var c=parseInt(b.root.style.top);
			var d=parseInt(b.root.style.left);
			b.root.onDragStart(d,c,a.clientX,a.clientY);
			b.lastMouseX=a.clientX;
			b.lastMouseY=a.clientY;
			document.onmousemove=Drag.drag;
			document.onmouseup=Drag.end;
			return false;
		},	
	"drag":function(a){
			a=Drag.fixE(a);
			var b=Drag.obj;
			var c=a.clientY;
			var d=a.clientX;
			var e=parseInt(b.root.style.top);
			var f=parseInt(b.root.style.left);
			var h,g;
			h=f+d-b.lastMouseX;
			g=e+c-b.lastMouseY;
			b.root.style.left=h+"px";
			b.root.style.top=g+"px";			
			b.lastMouseX=d;
			b.lastMouseY=c;
			b.root.onDrag(h,g,a.clientX,a.clientY);
			return false;
		},
	"end":function(){			
			document.onmousemove=null;
			document.onmouseup=null;
			Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style.left),parseInt(Drag.obj.root.style.top));
			Drag.obj=null;
		},
	"fixE":function(a){
			if(typeof a=="undefined")a=window.event;
			if(typeof a.layerX=="undefined")a.layerX=a.offsetX;
			if(typeof a.layerY=="undefined")a.layerY=a.offsetY;
			return a;
		}
};

function hideSelect(visibility){
	selects = document.getElementsByTagName('select');
	for(i = 0; i < selects.length; i++) {
		selects[i].style.visibility = visibility;
	}
}
function preIE(height, overflow){
		bod = document.getElementsByTagName('body')[0];
		bod.style.height = height;
		bod.style.overflow = overflow;
  
		htm = document.getElementsByTagName('html')[0];
		htm.style.height = height;
		htm.style.overflow = overflow;
}
function getRange() {
      var top     = document.documentElement.scrollTop;
      var left    = document.documentElement.scrollLeft;
      var height  = document.documentElement.clientHeight;
      var width   = document.documentElement.clientWidth;

      if (top==0 && left==0 && height==0 && width==0) {
        top     = document.body.scrollTop;
        left    = document.body.scrollLeft;
        height  = document.body.clientHeight;
        width   = document.body.clientWidth;
      }

      return  {top:top  ,left:left ,height:height ,width:width } ;
}
function showBox(e){
	if(typeof e=="undefined")e=window.event;
	
	//var lobj=e.srcElement;
	//var rel=lobj.getAttribute("url_re");
	var rel=this.location.href;

	hideSelect("hidden");
	WfloatBox.style.display="block";
	var range=getRange();
	
	WfloatBox.style.top=(range.top+WfloatBox.oy) +"px";
	WfloatBox.style.left=(range.left+WfloatBox.ox) +"px";
	window.onscroll=onbodyscroll;
}

function showBox_url(url_next,iflogin){
	if(iflogin=="true"){
		window.location=url_next;
	}else{
		var rel=this.location.href;
		if(url_next!=null && url_next!="" && typeof url_next!="undefined"){
			rel=url_next;
		}
	
		hideSelect("hidden");
		WfloatBox.style.display="block";
		var range=getRange();
		WfloatBox.style.top=(range.top+WfloatBox.oy) +"px";
		WfloatBox.style.left=(range.left+WfloatBox.ox) +"px";
		window.onscroll=onbodyscroll;
	}
}

function showChargeBox(e){
	if(typeof e=="undefined")e=window.event;
	hideSelect("hidden");
	WfloatBox2.style.display="block";
	var range2=getRange();
	WfloatBox2.style.top=(range2.top+WfloatBox2.oy) +"px";
	WfloatBox2.style.left=(range2.left+WfloatBox2.ox) +"px";
	window.onscroll=onbodyscroll;
}

function onbodyscroll(){
	var range=getRange();
	WfloatBox.style.top=(range.top+WfloatBox.oy) +"px";
	WfloatBox.style.left=(range.left+WfloatBox.ox) +"px";
}

function closeBox(){
	hideSelect("visible");
	WfloatBox.style.display="none";
}

function closeChargeBox(){
	hideSelect("visible");
	WfloatBox2.style.display="none";
}

function initbox2(){	

	var range=getRange();
	WfloatBox=getElement("floatBox");
	WfloatBox.ox=(range.width-200)/2;//400
	WfloatBox.oy=(range.height-400)/2;//300

	Drag.init(getElement("draghead"),WfloatBox);

	WfloatBox.onDragEnd=function(x,y){
		WfloatBox.ox=x-getRange().left;
		WfloatBox.oy=y-getRange().top;
	}
	//out_userid	= reply_getCookie("NETEASE_SSN");
	//document.getElementById("email").value = out_userid;

	
}

function initbox(){	

	var range=getRange();
	WfloatBox=getElement("floatBox");
	WfloatBox.ox=(range.width-400)/2;
	WfloatBox.oy=(range.height-300)/2;

	Drag.init(getElement("draghead"),WfloatBox);

	WfloatBox.onDragEnd=function(x,y){
		WfloatBox.ox=x-getRange().left;
		WfloatBox.oy=y-getRange().top;
	}
	out_userid	= reply_getCookie("NETEASE_SSN");
	//document.getElementById("email").value = out_userid;
	
	var range2=getRange();
	WfloatBox2=getElement("ChargeBox");
	WfloatBox2.ox=(range2.width-400)/2;
	WfloatBox2.oy=(range2.height-300)/2;
	Drag.init(getElement("draghead2"),WfloatBox2);
	WfloatBox2.onDragEnd=function(x,y){
		WfloatBox2.ox=x-getRange().left;
		WfloatBox2.oy=y-getRange().top;
	}
	
}


function userLogin()
{ 
document.getElementById("UserName").value=="";
if  (document.getElementById("tydyr").value=="")
  {
  alert("请填入姓名！");
  document.getElementById( "tydyr" ).focus ();
  return false;
  }

if  (document.getElementById("dylen").value=="")
  {
  alert("请填入您要定几份！");
  document.getElementById( "dylen" ).focus ();
  return false;
  }
  
  if  (document.getElementById("aosle").value=="")
  {
  alert("请填入通讯地址！");
  document.getElementById( "aosle" ).focus ();
  return false;
  }
  
  if  (document.getElementById("tlehome").value=="")
  {
  alert("请填入联络电话！");
  document.getElementById( "tlehome" ).focus ();
  return false;
   }
  

re=/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/; 
if (!re.test(document.getElementById( "email" ).value)) 
{alert("请正确填写邮箱地址\'n'xxx@xxx.com");
document.getElementById( "email" ).value = ""; 
document.getElementById( "email" ).focus (); 
return;
}
  
 if  (document.getElementById("zipwrod").value=="")
  {
  alert("请填入邮编！");
  document.getElementById( "zipwrod" ).focus ();
  return false;
  }
   if  (document.getElementById("textarea").value=="")
  {
  alert("请填入其它说明！");
  document.getElementById( "textarea" ).focus ();
  return false;
  }
    if  (document.getElementById("dy_add").value=="")
  {
  alert("请填入码验证码！");
  document.getElementById( "dy_add" ).focus ();
  return false;
  }
  
//=========订阅=================================
var mtid = document.getElementById("mtid").value;
var mtname = document.getElementById("mtname").value;
var tydyr= document.getElementById("tydyr").value;
var tlehome = document.getElementById("tlehome").value;
var dyno = document.getElementById("dyno").value;
var email = document.getElementById("email").value;
var dylen = document.getElementById("dylen").value; 
var zipwrod=document.getElementById("zipwrod").value;
var aosle=document.getElementById("aosle").value;
var textarea=document.getElementById("textarea").innerText;
var dy_add=document.getElementById("dy_add").value;
var url_xhtml_d_y="../../Inc/lx_dy.asp?f_ajax=d_y&mtid="+mtid+"&mtname="+mtname+"&tydyr="+tydyr+"&tlehome="+tlehome+"&dyno="+dyno+"&email="+email+"&dylen="+dylen+"&zipwrod="+zipwrod+"&aosle="+aosle+"&textarea="+textarea+"&dy_add="+dy_add;
loadAJAXTab(url_xhtml_d_y,22);//mt_conte提交订阅加反回
//=========订阅=================================
//alert (mtid+mtname+tydyr+tlehome+dyno+email+dylen+zipwrod+aosle+textarea);
///////////////////////////
}
//ajax开始
//--------------------
function getXmlhttp()
{
	var http_request;
	
	if(window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) { 
		window.alert("can't create XMLHttpRequest object.");
		return null;
	}	
	return http_request;
}
//***************************打开ajax并反回数据**********************
function loadAJAXTab(url,contentid){
		var xhttp=getXmlhttp();		
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{	
				   if (contentid ==11){
					document.getElementById("content").innerHTML=xhttp.responseText;
				   }
				   if (contentid ==22){
					document.getElementById("mt_conte").innerHTML=xhttp.responseText;
				   }
				}
			}
		xhttp.open("GET",url,true);
		xhttp.send(null);
}
//ajax---结束
//=========================================//

//清空mt_conte
function toupmt_conte()
{
document.getElementById("mt_conte").innerHTML ="";
}
//===============================
//媒体联系查询开始
function dyajaxInfo()
{
//=========联系=================================
var UserName=document.getElementById("UserName").value;
var UserName_mtid=document.getElementById("UserName_mtid").value;
var url_xhtml_lx="../../Inc/lx_dy.asp?f_ajax=lx&UserName="+UserName+"&UserName_mtid="+UserName_mtid;
loadAJAXTab(url_xhtml_lx,11);//content查联系方式
//=========联系=================================
}

var cookies = new String(document.cookie);
function reply_getCookie(namex)
{
	var cookieHeader = namex + "=";
	var beginPosition = cookies.indexOf(cookieHeader);
	if (beginPosition != -1) 
	{
		var acookie = cookies.substring(beginPosition + cookieHeader.length);
		if (acookie.indexOf(";")>-1)
		{
			acookie = acookie.substring(0, acookie.indexOf(";"));
		}
		return acookie;
	}
	return "";
}

//window.onload=initbox;