﻿var ISN=new Object();

//====================================
//调用页面需要提供以下:
	ISN.ServerLocation="";
	ISN.Domain="";
//===================================

//==接口类=========
ISN.iFeedBack=function(inceptID){
	location="../page.asp?g=Feedback&inceptID="+inceptID+"&ref="+encodeURIComponent(location.href);
}

ISN.iRecommend=function(title){
	location=location.pathname+"?g=Recommend&title="+encodeURIComponent(title)+"&ref="+encodeURIComponent(location.href);
}

ISN.iDownload=function(typeID,showID,dlUrl){
	window.open("download.asp?g=download&typeID="+typeID+"&showID="+showID+"&dl="+encodeURIComponent(dlUrl));
}

//===================================

ISN.Location=ISN.ClientLocation="http://"+location.host;
ISN.Proxy=ISN.ServerProxy="http://"+location.host+"/ISN_App_v3.21/ISN_Proxy.asp";

ISN.errorCode=0;
ISN.reason="";
ISN.ClientPort="";
ISN.SessionID="";
ISN.Pass="";
ISN.Domain;

ISN.readyState="loading";

ISN.isRemoteRequest=function(requestUrl){
if(typeof requestUrl!="undefined"){
	if(requestUrl.indexOf("http://")!=0) return false;
	else if(requestUrl.indexOf("http://"+location.host)!=0) return true;
	else return false;
}
else return false;
}


ISN.LoadScript=function(url){
	document.write('<scr'+'ipt type="text/javascript" src="'+url+'"><\/scr'+'ipt>');
}

ISN.LoadCss=function(url){
var d=document.createElement("link");
	d.setAttribute("rel","stylesheet");
	d.setAttribute("type","text/css") ;
	d.setAttribute("href",url);
	if(typeof d!="undefined")
		document.getElementsByTagName("head")[0].appendChild(d);
}

ISN.setOnLoadCallback=function(callback){
	if(this.readyState=="complete") return eval(callback);
	else return setTimeout("ISN.setOnLoadCallback("+callback+")",200);
}

ISN.GetUrlParam=function(paramName)
{
	var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
	var oMatch = oRegex.exec( window.location.search ) ;
	if (oMatch && oMatch.length > 1 ) return decodeURIComponent( oMatch[1] ) ;
	else return '' ;
}

ISN.HTMLEncode = function( text )
{
	if ( typeof( text ) != "string" )
		text = text.toString() ;

	text = text.replace(
		/&/g, "&amp;").replace(
		/"/g, "&quot;").replace(
		/</g, "&lt;").replace(
		/>/g, "&gt;") ;

	return text ;
}

ISN.DelThumbnail=function(fieldId){

var obj=$(fieldId);
if(obj!=null){
	if(funConfirm('确认要删除这个缩图嘛？')){
		obj.value='';
		if($("pre_"+fieldId)!=null) $("pre_"+fieldId).src="/ISN_Global_v3.21/pic/pickpic.gif";
		if($("del_"+fieldId)!=null) $("del_"+fieldId).style.display="none";
	}
}
}


//==============DivDialog.js====================
DivDialog=new Object();
	var Logout = false;
	var Auth = false;
	var isMouseDown = 0;
	var offsetX = 0;
	var offsetY = 0;
	var intervalIDdialog;

/** 操作进度提示  */
DivDialog.Operating=function(){

	if($("PageLoading") != null) return;
//   this.Mark(2);
    var popup2 = document.createElement("DIV");
    popup2.id = "PageLoading";
    popup2.innerHTML = "<div style=\"position:absolute; right:43%; top:40%; background:#C5C5C5;\">"
                    + "<div style=\"position:relative; left:-2px; top:-2px;font-size:14px; background:#F0F7FA; padding:6px 8px; border:solid 1px #0C83C1; color:#19538E;\">"
                    + "<img src=\"/ISN_Global_v3.21/loading.gif\" align=\"absmiddle\"/>"
                    + "操作正在进行中，请等待...";
                    + "</div></div>";
    //增加操作进度
	document.body.insertBefore(popup2,$("layout"));
}
/* ** 禁止操作(Mark) */
 DivDialog.Mark=function(type){
    if($("DivMark") != null)
        return;
        
    var mark = document.createElement("DIV");
    mark.id = "DivMark";
    mark.style.height = document.body.offsetHeight + "px";
    if(type == 0){
//        SetDropList(false,loadingIframeId);
        mark.className = "popup-man";
    }
    else if(type == 1){
        mark.className = "popup-man-operate";
 //       SetDropList(false,loadingIframeId);
    }
    else if(type == 2){
        mark.className = "popup-man-tabloading";
//        SetDropList(false,loadingIframeId);        
    }    
    
    document.body.appendChild(mark);    
 }



DivDialog.DeleteDialog=function(id){
    var obj = $(id);
//	alert(obj)
    if(obj != null){
        document.body.removeChild(obj);
    }
}
