// JavaScript Document
var siteRoot = "";

function popWindow( url, width, height, windowName, use_scroll) {
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var scrollable = (use_scroll) ? "yes" : "0";
	newwindow = window.open(url, windowName, 'toolbar=0,scrollbars='+scrollable+',location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

function popSignup(){
	popWindow("etqw_signup.htm", 540, 570, "signup");
}
function popIM(lang){
	popWindow("im/etqw_im.html?language="+lang, 540, 570, "aim");
}
function popPreorder(){
	popWindow("preorder/popup_preorder.html", 453, 580, "preorder");
}

function popWall(imgpath, w, h, lang){
	//popWindow(_root + "wallpaper.html?image="&imgpath, 800, 600, "wallpaper");
	var url = siteRoot + "wallpaper.html?image=" + imgpath + "&language="+lang;
	var windowName = "wallpaper"
	var width = w;
	var height = h;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	newwindow = window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

function popSS(imgpath, desc){
	//popWindow(imgpath, 1024, 768, "ss");
	popWindow("popup_ss.html?image=" + imgpath + "&desc=" + desc, 1024, 768, "ss");
}

function newWindow(url){
	newwindow = window.open(url);
}

function saveFile(file){
	file = "_swf/_videos/" + file;
	newwindow = window.open(file, 'file');
	window.close('file');
}

function popVideo(file, w, h, ftype){
	var cid = "";
	file = "_swf/_videos/" + file;
	var url= siteRoot + "/video.html?msizeW="+w+"&msizeH="+h+"&country="+cid+"&type="+ftype+"&movie="+file;
	popWindow(url, 490,  400, 'video');
}



function popQT(file, w, h, ftype){
	popVideo(file, w, h, ftype);
}

function popAVI(file, w, h, ftype){
	popVideo(file, w, h, ftype);
}

function popIPOD(file, w, h, ftype){
	popVideo(file, w, h, ftype);
}

function popPSP(file, w, h, ftype){
	popVideo(file, w, h, ftype);
}

