function creat_ajax(){
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
return xmlHttp;
}
var time=(new Date).getTime();var op=navigator.userAgent;var zindex;
$=function(o){return document.getElementById(o);}

window.png=function (id,img){
o=$(id);if(o){if(DragUtil.isIE){
o.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+img+")"; 
}else{o.innerHTML='<img src="'+img+'" />';}}}
function Html(html){
arr=html.split('<script>');if(arr[1]){arr[1]=arr[1].replaceAll('<\/script>','');}return arr;}String.prototype.replaceAll  = function(s1,s2){return this.replace(new RegExp(s1,"gm"),s2); }

function get(id,url,re,show){
var xmlHttp=false;if(show){document.getElementById(id).innerHTML = '数据读取中...';}xmlHttp=creat_ajax();xmlHttp.open('GET',url,true);xmlHttp.onreadystatechange= function(){if (xmlHttp.readyState == 4 ) {str= Html(xmlHttp.responseText);if(str[0]){document.getElementById(id).innerHTML =str[0];}if(re){eval(str[1]);}}}
xmlHttp.setRequestHeader("contentType","text/html;charset=uft-8")
xmlHttp.send(null);}

window.submit_value=function (u){if(u){str='';t=u.split(',');for(i=0;i<t.length;i++){if($(t[i])){str=str+t[i]+'='+$(t[i]).value+'&';}}return str;}else{return 'null';}}

function post(id,url,p,js){//post
var xmlHttp=false;
xmlHttp=creat_ajax();
xmlHttp.open('POST',url,true);
xmlHttp.onreadystatechange= function(){if (xmlHttp.readyState == 4) {
str= Html(xmlHttp.responseText);
document.getElementById(id).innerHTML =str[0];
if(js){eval(str[1]);}
}}
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
xmlHttp.send(p);
}

function remove(name){if($(name)){$(name).parentNode.removeChild($(name));}}




function creat_div(name,title,width,url){zindex++;
if(op.indexOf("IE")!=-1){var l=event.clientX+document.documentElement.scrollLeft;var t=event.clientY + document.documentElement.scrollTop;}else{var l=event.pageX;var t=event.pageY;}
if($(name)){
$(name).style.left=l+'px';$(name).style.top=t+'px';
}else{
obj=document.createElement('div');obj.id=name;
obj.style.cssText='z-index:'+zindex+';position:absolute;top:'+t+'px;left:'+l+'px;width:'+width+'px;margin:5px';document.body.appendChild(obj);}
if(url!=""){get(name,url,true,false);}
//v_time=setTimeout("remove('"+name+"')",5000);
}

function creat_box(name,title,width,url){zindex++;
var h=10;

if(op.indexOf("IE")!=-1){var t=(document.documentElement.scrollTop+h);var l=(document.documentElement.clientWidth-width)/2;remove(name);}else{var l=event.pageX;var t=event.pageY;}
obj=document.createElement('div');obj.id=name;
obj.style.cssText='z-index:'+zindex+';position:absolute;top:'+t+'px;left:'+l+'px;width:'+width+'px';document.body.appendChild(obj);if(url!=""){get(name,url,true,false);}
}

function success_msg(c){
$("box").innerHTML='<div class="div_box"><div id="pro_info" style="width:95%"><a style="text-indent:15px">您已经成功提交了留言</a><div class="line"style="text-indent:20px">您好，您已经成功提交留言，我们会尽快给您答复的。</div><div class="line"style="text-indent:20px">我们会记录您的留言状态，以便给您更多的信息。如果您需要查看您的留言，请点击此下面查看留言，并输入此号码：<font color="#cc0000">'+c+'</font>，或者您的姓名与联系电话或者email即可。</div><div class="line"style="text-indent:20px">非常感谢您的支持，我们将开发更多好的产品，敬请期待。最后，祝您生意兴荣。</div></div><div class="line"><div></div>';
setTimeout('location.href="view_msg.php"',5000);
}
	
function creat_img(img){
creat_box('box','img','800','');
$('box').innerHTML='<div class="img_box"><img src="./images/'+img+'" onclick="remove(\'box\')"/></div>';
}
