<!--
function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
 var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
  windowProperties+='toolbar=yes,'; if(loc==false) windowProperties+='location=no,'; 
 else windowProperties+='location=yes,'; if(sts==false) windowProperties+='status=no,';
 else windowProperties+='status=yes,'; if(menu==false) windowProperties+='menubar=no,';
 else windowProperties+='menubar=yes,'; if(scroll==false) windowProperties+='scrollbars=no,';
 else windowProperties+='scrollbars=yes,'; if(resize==false) windowProperties+='resizable=no,';
 else windowProperties+='resizable=yes,'; if(w!="") windowProperties+='width='+w+',';
 if(h!="") windowProperties+='height='+h; if(windowProperties!="") { 
  if( windowProperties.charAt(windowProperties.length-1)==',') 
   windowProperties=windowProperties.substring(0,windowProperties.length-1); } 
 window.open(url,name,windowProperties);
}

function OpWin(UrlStr){
FP_openNewWindow('', '', false, false, false, false, true, true, 'Flash', /*href*/''+UrlStr)
}

function checkRate(str)
{
     var re = /^[1-9]+[0-9]*]*$/;   //判断字符串是否为数字/^[0-9]+.?[0-9]*$/     //判断正整数 /^[1-9]+[0-9]*]*$/   
     if (!re.test(str)) {
        return false;
    } else {
		return true;
	}
}

var Cookie= {
        Set : function (){
                var name = arguments[0], value = escape(arguments[1]),
                days = (arguments.length > 2)?arguments[2]:365,
                path = (arguments.length > 3)?arguments[3]:"/";
                with(new Date()){
                        setDate(getDate()+days);
                        days=toUTCString();
                }
                document.cookie = "{0}={1};expires={2};path={3}".format(name, value, days, path);
        },
        Get : function (){
                var returnValue=document.cookie.match(new RegExp("[\b\^;]?" + arguments[0] + "=([^;]*)(?=;|\b|$)","i"));
                return returnValue?unescape(returnValue[1]):returnValue;
        },
        Delete : function (){
                var name=arguments[0];
                document.cookie = name + "=1 ; expires=Fri, 31 Dec 1900 23:59:59 GMT;";
        }
}

//JS等比缩略图 //示例使用：onload="DrawImage(this,120,90);"
function DrawImage(ImgD,iw,ih){
    var image=new Image();
    var iwidth = iw; //定义允许宽度，当宽度大于这个值时等比例缩小
    var iheight = ih; //定义允许高度，当高度大于这个值时等比例缩小
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
        flag=true;
        if(image.width/image.height>= iwidth/iheight){
            if(image.width>iwidth){
                ImgD.width=iwidth;
                ImgD.height=(image.height*iwidth)/image.width;
            }else{
                ImgD.width=image.width;
                ImgD.height=image.height;
            }
        }else{
            if(image.height>iheight){
                ImgD.height=iheight;
                ImgD.width=(image.width*iheight)/image.height;
            }else{
                ImgD.width=image.width;
                ImgD.height=image.height;
            }
        }
    }
}

//JS等比缩略图2 使用示例：onload="Resize(this,'50,50');"
function Resize(drawImage,thumbs_size) {
    var max = thumbs_size.split(',');
    var fixwidth = max[0];
    var fixheight = max[1];
    w=drawImage.width;h=drawImage.height;
    if(w>fixwidth) { drawImage.width=fixwidth;drawImage.height=h/(w/fixwidth);}    
    if(h>fixheight) { drawImage.height=fixheight;drawImage.width=w/(h/fixheight);}          
    drawImage.style.cursor= "pointer";    
    //drawImage.onclick = function() { window.open(this.src);}     
    //drawImage.title = "点击查看原始图片";   
}

//JS等比缩图（裁剪）使用示例：onload="Zoom(this,120,90);"
function Zoom(obj, width, height){
    var img = new Image();
    img.src = obj.src;
    var scale = Math.max(width / img.width, height / img.height);
    var newWidth = img.width * scale;
    var newHeight = img.height * scale;
    var div = obj.parentNode;

    obj.width = newWidth;
    obj.height = newHeight;
    div.style.width = width + "px";
    div.style.height = height + "px";
    div.style.overflow = "hidden";
    obj.style.marginLeft = (width - newWidth) / 2 + "px";
    obj.style.marginTop = (height - newHeight) / 2 + "px";
}


function request(paras){ 
var url = location.href;   
var paraString = url.substring(url.indexOf("?")+1,url.length).split("&");   
var paraObj = {}   
for (i=0; j=paraString[i]; i++){   
paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf 
("=")+1,j.length);   
}   
var returnValue = paraObj[paras.toLowerCase()];   
if(typeof(returnValue)=="undefined"){   
return "";   
}else{   
return returnValue;   
}   
} 
var theurl 
theurl=request("url"); 
if (theurl!=''){ 
location=theurl 
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    } else {
        return document[movieName]
    }
}

function getCurrentUrlJstoFla() {
jQuery(document).ready(function() {
//alert(window.location.href.replace('\&','^'));
//alert(location.search.substr(1));
thisMovie('Top_menu').SetVariable("Lang.currentUrl", window.location.href.replace('\&','^'));
});
}

function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}

function checkEmail(xstr,sid)
{
     var emailtest=/^[0-9a-z][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}[0-9a-z]\.){1,4}[a-z]{2,4}$/i;
     if(emailtest.test(xstr)) {
		 return true;
     } else {
		 $("#"+sid).focus();
		 setbg("#"+sid);
		 return false;
     }
	 
	 return false;
}

function checkRate(xstr,sid)
{
     var ratetest=/^[0-9]*[1-9][0-9]*$/i;
     if(ratetest.test(xstr)) {
		 return true;
     } else {
		 $("#"+sid).focus();
		 setbg("#"+sid);
		 return false;
     }
	 
	 return false;
}

function setbg(oid){
   $(oid).css('background-image','url(images/input_bg.jpg)');
   $(oid).css('backgroundPosition','0px -6px');
   $(oid).css('backgroundRepeat','repeat-x'); 
}

$(function(){
	$(document).pngFix(); 
});
// -->
