/**
 * 
 * @param url
 */
function redirect(url) {
	window.location = url;
}

/**
 * 
 * @param o
 * @param prop
 * @returns
 */
function css(o,prop){
    if(window.getComputedStyle){
        return document.defaultView.getComputedStyle(o,null).getPropertyValue(prop);
    }else{
        var re = /(-([a-z]){1})/g;
        if (prop == 'float') prop = 'styleFloat';
        if (re.test(prop)) {
            prop = prop.replace(re, function () {
                return arguments[2].toUpperCase();
            });
        }
        return o.currentStyle[prop] ? o.currentStyle[prop] : null;
    }
}  

/**
 * 
 * @returns {Number}
 */
function getNextHighestDepth(){
    var col=document.getElementsByTagName('*'),l=col.length,i,mx=0,t;
    for(i=0;i<l;i++){
        t=parseInt(css(col[i],'z-index'));
        if(t && t>mx)
            mx=t;
    }
    return mx+1;
}

/**
 * 
 * @returns
 */
var maskpanel_incoming=function() {  
	this.divobj;  
	this.show=function() {  
		if(!document.getElementById("xdivmasking_incoming")) {  
			var divEle=document.createElement('div');  
			divEle.setAttribute("id","xdivmasking_incoming");  
			document.body.appendChild(divEle);  
			var divSty=document.getElementById("xdivmasking_incoming").style;  
			divSty.position="absolute"; divSty.top="0px"; divSty.left="0px";  
			divSty.zIndex="46"; divSty.opacity=".50";divSty.backgroundColor="#000";  
			divSty.filter="alpha(opacity=50)";  
		}    
		this.divobj=document.getElementById("xdivmasking_incoming");  
		var dsh=document.documentElement.scrollHeight;  
		var dch=document.documentElement.clientHeight;  
		var dsw=document.documentElement.scrollWidth;  
		var dcw=document.documentElement.clientWidth;
		var bdh=(dsh>dch)?dsh:dch;  
		var bdw=(dsw>dcw)?dsw:dcw;		
		this.divobj.style.height=bdh+'px';  
		this.divobj.style.width=bdw+'px';    		
		this.divobj.style.display="block";
	};  
  this.hide=function() {  		
		this.divobj.style.display="none";
	};  
}

/**
 * 
 */
var divmask_incoming;

/**
 * 
 * @returns
 */
var maskpanel_login=function() {  
	this.divobj;  
	this.show=function() {  
		if(!document.getElementById("xdivmasking_login")) {  
			var divEle=document.createElement('div');  
			divEle.setAttribute("id","xdivmasking_login");  
			document.body.appendChild(divEle);  
			var divSty=document.getElementById("xdivmasking_login").style;  
			divSty.position="absolute"; divSty.top="0px"; divSty.left="0px";  
			divSty.zIndex="46"; divSty.opacity=".50";divSty.backgroundColor="#000";  
			divSty.filter="alpha(opacity=50)";  
		}    
		this.divobj=document.getElementById("xdivmasking_login");  
		var dsh=document.documentElement.scrollHeight;  
		var dch=document.documentElement.clientHeight;  
		var dsw=document.documentElement.scrollWidth;  
		var dcw=document.documentElement.clientWidth;
		var bdh=(dsh>dch)?dsh:dch;  
		var bdw=(dsw>dcw)?dsw:dcw;		
		this.divobj.style.height=bdh+'px';  
		this.divobj.style.width=bdw+'px';    		
		this.divobj.style.display="block";
	};  
  this.hide=function() {  		
		this.divobj.style.display="none";
	};  
}

/**
 * 
 */
var divmask_login;

/**
 * 
 * @param name
 * @returns
 */
function get_cookie(name){
  var cname = name + "=";
  var dc = document.cookie;
  if (dc.length > 0) 
  {              
    begin = dc.indexOf(cname);
	if (begin != -1) 
	{           
	  begin += cname.length;
	  end = dc.indexOf(";", begin);
	  if (end == -1) end = dc.length;
	  return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

/**
 * 
 * @param title
 * @param flash
 * @param group
 * @param user
 * @param locale
 */
function call(title, flash, group, user, locale)
{
	var pv = window.open('',title,'width=470,height=397');
	var src = '<embed src="'+flash+'/cn/arpaflashclient.swf" width="100%" height="95%" align="middle" play="true" loop="false" quality="high"  allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashVars="channel='+group+'&requestfor='+user+'&call=true&locale='+locale+'" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	var html = "<html><head><title>"+title+"</title></head><body>"+src+"</body></html>";
	pv.document.open();
	pv.document.write(html);
	pv.document.close();
	return;
}