// http://www.asarconsult.com
// Design & Web Programming by Oracle Idea , Yasser Soltanieh
// © 2008
// Start Code --->
//
window.onerror = function()
{
    return true;
}
var approximateWidth = Math.round(screen.width);
var approximateHeight = Math.round(screen.height)-30;
function maximizeWindow()
{
    window.moveTo(0,0);
    window.resizeTo(approximateWidth,approximateHeight);
}
function openWindow(windowLink)
{
    var detectionResult = window.document.getElementById("JavaScriptAndScreenResolution").value;
    if(detectionResult == "true"){
	    window.open(windowLink,"oiWebsite","channelmode=0,directories=0,fullscreen=0,location=1,menubar=0,resizable=0,scrollbars=0,status=1,titlebar=0,toolbar=0,top=0,left=0,width="+approximateWidth+",height="+approximateHeight,false);
    }
}
function closeWindow()
{
	window.close();
}
function controlNormalWindow()
{
    if(window.name == "oiWebsite")
    {
        if(window.opener.closed)
        {
            var redirectLink = "/";
            window.open(redirectLink);
        }
        closeWindow();
    }
}
function controlPopUpWindow()
{
    if(window.name != "oiWebsite")
    {
        var redirectLink = "/";
        window.location = redirectLink;
    }
}
function detectResolution()
{
    if (approximateWidth < 1024 || approximateHeight < 690)
    {
        var detectionResult = "incompatible";
    }
    else
    {
        var detectionResult = "true";
    }
    window.document.getElementById("JavaScriptAndScreenResolution").value = detectionResult;
}
function focusWindow()
{
	window.focus();
}
function blurWindow()
{
	window.blur();
}
function getAdobeFlashPlayer()
{
    var adobeLink = "http://www.adobe.com/go/getflashplayer";
    window.open(adobeLink,"oiAdobe","channelmode=0,directories=1,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=1,top=0,left=0,width="+Math.round(3*approximateWidth/4)+",height="+Math.round(approximateHeight/2),false);
}
function hideStatus()
{
    window.status = ' ';
}
//
// End Code <---