//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

/* BEGIN: Disable the "right click" on the website */
/*
var message=".: The Official Site of Tia Kai :. Copyright 2007";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
*/
/* END: Disable the "right click" on the website */

/* BEGIN: Creates text in the status bar */
window.status=".: The Official Site Of Tia Kai :."

function SetStatusText()
{
	window.status=".: The Official Site Of Tia Kai :."; return true;
}
/* END: Creates text in the status bar */

/* BEGIN: opens a new window for the images */
function newWindow(strFilename, intWidth, intHeight)
{
	//var winW = Math.round((screen.width - intWidth) / 2);
	//var winH = Math.round((screen.height - intHeight) / 2);
		
	win = window.open("ViewImage.aspx?fileName=" + strFilename + "","ViewImage","status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no");
	
	/*
	if (intWidth < 800)
	{
		if (intHeight < 600)
		{
			win.resizeTo((intWidth + 10),(intHeight + 90));
		}
		else if (intHeight < 1000)
		{
			win.resizeTo(((intWidth * 0.75) + 10),((intHeight * 0.75) + 90));
		}
		else
		{
			win.resizeTo(((intWidth * 0.50) + 10),((intHeight * 0.50) + 90));
		}
	}
	else if (intWidth < 1200)
	{
		if (intHeight < 800)
		{
			win.resizeTo(((intWidth * 0.75) + 10),((intHeight * 0.75) + 90));
		}
		else if (intHeight < 1200)
		{
			win.resizeTo(((intWidth * 0.50) + 10),((intHeight * 0.50) + 90));
		}
		else
		{
			win.resizeTo(((intWidth * 0.40) + 10),((intHeight * 0.40) + 90));
		}
	}
	else
	{
		win.resizeTo(((intWidth * 0.50) + 10),((intHeight * 0.50) + 90));
	}*
	*/
	win.resizeTo((intWidth + 30),(intHeight + 67));
		
	//win.moveTo(winW,winH);				
}
/* END: opens a new window for the images */

function ErrorMessage(strMessage, blnRedirect, strURL)
{
	alert(strMessage);
	
	if (blnRedirect == "true")
	{
		window.location = "http://www.tiakai.com/" + strURL;
	}	
}
		