﻿var tanchu=0;
var mytitle="美凯创意";
var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};
//返回swf地址
function geturl(){
	var thisurl=document.location.href.split("#")[1];
	if(thisurl!=""&&thisurl!="null"){
		return thisurl;
	}else{
		return "index";
	}
}
//网站标题
function settitle(){
	if(tanchu!=1){
		document.title=mytitle;
	}
}
//IE前进后退
function staturl(url1){
	$('stat').onreadystatechange=null;
	if(tanchu!=1){
		$("stat").src=url1;
	}
}
function sizeresize(){
	//document.getElementById("maxtable").style.height="700px";
	//document.getElementById("myflash").style.width=1040;
	//document.getElementById("myflash").style.height=637;
}
//返回页面地址
function getweburl(){
	var thisurl=""
	if(tanchu!=1){
		thisurl=document.location.href.split("index2.htm#")[0];
	}else{
		thisurl=document.location.href.split("index2.htm")[0];
	}
	thisurl=thisurl.split("#")[0];
	return thisurl;
}
function setdowny(sheight){
	$("down").style.marginTop=sheight-20;
}
//showdiag
var showdiagurl=""
function showdiagfun(url){
	showdiagurl=url;
	$("showdiag").click();
}
//网页加载成功
window.onload = function() {
	var so = new SWFObject("swf/home.swf?val=1&rnd="+Math.random(), "myflash", "1200", "560", "9");
	//so.addParam("wmode", "transparent");
	//so.addParam("allowFullScreen","true");
	so.write("flashcontent");
	resizefun();
}
function resizefun(){
	if($("myflash")){
		var cheight=document.documentElement.clientHeight;
		var cwidth=document.documentElement.clientWidth;
		
		if(cwidth<1200){
			cwidth=1200;
		}
		if(cwidth<560){
			cwidth=560;
		}
		
		$("content").style.marginLeft=((cwidth-1200)*0.5>>0)+"px";
		$("content").style.marginTop=((cheight-560)*0.5>>0)+"px";
		//var ctrl=$("myflash"); 
		//ctrl.focus();
		//ctrl.height=cheight+"px";
		//ctrl.width=cwidth+"px";
	}
}
