function oRoll(img)
{
	var x=(img.prevSrc?0:1);
	img.src=img.src.replace(/_\d/,"_"+x);
	img.prevSrc=x;
}

function openWindow(url, width, height, type, winName) {
	var paramStr="";
	if (type=="console") {
		paramStr="resizable,height="+height+",width="+width;
	} else if (type=="fixed") {
		paramStr="status,height="+height+",width="+width;
	} else if (type=="content") { // fixed size with scrolling
		paramStr="scrollbars,status,height="+height+",width="+width;
	} else if (type=="normal") { // a normal window but with width & height set
		paramStr="status,toolbar,menubar,scrollbars,resizable,location,height="+height+",width="+width;
	} else if(!type || type=="flexible") { // default
		paramStr="scrollbars,resizable,height="+height+",width="+width;
	}
	if(!winName) { // make unique but consistent window name for this page
		winName = 'myWin_'+url.substr(0,url.indexOf("?")).replace(/\W/g,"");
	}
	winObj = window.open(url, winName, paramStr);
	winObj.focus();
	return winObj;
}
function openClientConnect()
{
	openWindow( 'http://69.25.50.10', 680, 500, 'normal' );
	/* old urls:
	http://69.25.50.11
	http://69.25.50.10:8443/guest/login
	http://69.25.50.10:8443/guest/irg.html
	http://69.25.50.10:8443/guest/irg.html
	http://69.25.50.11
	*/
}
function openPDFwin(pdf)
{
	openWindow( pdf, 550, 450, 'normal' );
}
function openContact()
{
	openWindow( '/contact_form.php', 400, 400 );
}
function openPlacement()
{
	openWindow( '/placement_form.php', 600, 800 );
}
function openPrivacy()
{
	openWindow( '/privacy.php', 500, 400, 'content' );
}
function opensitemap()
{
	go( '/sitemap.php', 800, 1000, 'content' );
}
function openfaq()
{
	openWindow( '/faq.php', 500, 400, 'content' );
}
function opentou()
{
	openWindow( '/tou.php', 500, 400, 'content' );
}
function openChat(url)
{
	openWindow( url, 484, 361, 'fixed' );
}

function go(url)
{
	location.href = url;
}
function languageSelect(sel)
{
	var l = sel.options[sel.selectedIndex].value;
	var path = location.pathname;
	var sp = false;
	if(path.substring(0,3)=='/sp') {
		sp = true;
	}
	if(l=='en') {
		if(sp) {
			path = path.substring(3);
			location.href = path;
		}
	} else if(l=='sp') {
		if(!sp) {
			location.href = '/sp'+path;
		}
	}
}



function hilite(obj,x)
{
	if(x) {
		obj.style.backgroundColor = '#C8C4A4';
		obj.style.fontWeight = "bold";
	} else {
		obj.style.backgroundColor = '#DBD8C0';
		obj.style.fontWeight = "normal";
	}
}

function cross_obj(id,styles,framenum)
{
	var obj, obj_base;
	if(cross_obj.arguments.length==3) {
		obj_base = window.parent.frames[framenum].document;
	}
	else
		obj_base = window.document;
	if(cross_obj.arguments[1]!=0) styles=true;
	//alert(styles);
	if(document.all)
		if(styles) { obj=obj_base.all[id].style; }
		else obj=obj_base.all[id];
	else if(document.layers)
		obj=obj_base.layers[id];
	else if(document.getElementById)
		if(styles) obj=obj_base.getElementById(id).style;
		else obj=obj_base.getElementById(id);
	else return false;
	if(obj) return obj;
	else return false;
}