// flashWrite(url, width, height, id, bg, window)
function flashWrite(url,w,h,id,bg,win){

	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	document.write(flashStr);

}
// Tab Content
function tabView(obj,viewCont){
try{
	var tabBox = obj.parentNode.childNodes;
	var viewBox = document.getElementById(viewCont).childNodes;
	for(i=0;i<viewBox.length;i++){
		if(viewBox[i].nodeType == 1){
			if(obj == tabBox[i]){
				tabBox[i].className = "on";
				viewBox[i].style.display = "block";
			}else{
				tabBox[i].className = "";
				viewBox[i].style.display = "none";
			}
		}
	}
}catch(e){alert(e)}
}
try {
  document.execCommand('BackgroundImageCache', false, true);
}catch(e){
}

// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

////// menu //////

$(document).ready(function() {
  $('#header_game_link').mouseover(function() {
    $(".header_game_menu").show(function() {
      this.blur();
      return false;
    })
  })
  $('#body_warp').mouseover(function() {
    $(".header_game_menu").hide();
  })
  $('.logo').mouseover(function() {
    $(".header_game_menu").hide();
  })
});


function goDownload(){
	//alert("The Download link will deliver soon.")
	window.open(document.frmUrlDefine.Download_URL.value);
};

function free_down1(){
 document.freedown_btn.SetVariable("js_variable", "1");
}
function free_down2(){
 document.freedown_btn.SetVariable("js_variable", "2");
}

function goForum(){
	window.open('http://outspark.com/forums/forumdisplay.php?f=141');
};

function forumEvent1(){
	document.forum.SetVariable("js_variable", "1");
}

function forumEvent2(){
	document.forum.SetVariable("js_variable", "2");
}

function goRegister(){
	var RegisterURL = document.frmUrlDefine.Register_URL.value;
	location.href=RegisterURL;
}

function testMenu(id,subId){
	var objMenu = document.getElementById(id);
	var subMenu = document.getElementById(subId);
	objMenu.onmouseover = function(){ subMenu.style.display="block"; }
	objMenu.onmouseout = function(){ subMenu.style.display="none"; }
}

