function setHome(obj,url){
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage(url);
}

function saveit(){
    var theform=document.form1;
    var sortid=document.getElementsByName("sortid."+iphoecode)[0];
    var title=document.getElementsByName("title."+iphoecode)[0];
    var url=document.getElementsByName("url."+iphoecode)[0];
    if(sortid!=null&&title!=null&&url!=null){
        if(sortid.value==''){
            alert('站点类别请准确选择!')   
        }else if(title.value.length==0){
            alert('站点名称请填写完整!');
        }else if(url.value.length<8){
            alert('站点网址请填写完整!');
        }else{
            theform.action='weblinksave.asp?mkey='+iphoecode+iphoecode;
            theform.target='_blank';
            theform.submit();
        }
    }    
}    
function openWindow(url,name,width,height,feater){
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	var win=window.open(url,name,"height="+height+",width="+width+",top="+wint+",left="+winl+","+feater);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

function add_link(fromsite){
    window.open('addlink.asp?fromsite='+fromsite);
}

function submitWindow(form,url,target,width,height){
    form.action=url;
    form.target=target;
    openWindow(url,target,width,height);
    form.submit();
}


