﻿// JScript File

function openPlayerzz()
{
    newWindow('player/default.aspx', 'lifeloungeplayer', 538, 248, 'no', 'top');
}

function compWinner(page)
{
    alert(page);
    newWindow(page, 'compWinner', 400, 400, 'no', 'center');
}

function newWindow(mypage,myname,w,h,scroll,pos)
{
    var win=null;
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=50;TopPosition=50}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win=window.open(mypage,myname,settings);
}


function stripHTML()
{
    var re= /<\S[^><]*>/g
    for (i=0; i<arguments.length; i++)
        arguments[i].value=arguments[i].value.replace(re, "")
}

function DoSearch(searchFor)
{
    alert('do search');
}

function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		if (style2.display == "")
		{
			style2.display = style2.display? "":"none";
		}
		else
		{
			style2.display = style2.display? "":"block";
		}
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		if (style2.display == "")
		{
			style2.display = style2.display? "":"none";
		}
		else
		{
			style2.display = style2.display? "":"block";
		}
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		if (style2.display == "")
		{
			style2.display = style2.display? "":"none";
		}
		else
		{
			style2.display = style2.display? "":"block";
		}
	}
}

function showLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
    	style2.display = "block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = "block";
	}
}

function hideLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "none";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = "none";
	}
}

function toggleLayer2(showLayer, hideLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(showLayer).style;
		if (style2.display == "none")
		{
			style2.display = "block"; //style2.display? "":"none";
		}
		else
		{
		    style2.display = "none"; //style2.display? "":"block";
		}
		
		// hide
        var style3 = document.getElementById(hideLayer).style;
		if (style3.display == "block")
		{
			style3.display = "none"; // style3.display? "":"block";
		}
		else
		{
			style3.display = "block"; //style3.display? "":"none";
		}
	}
	else if (document.all)
	{
	    alert('2');
		// this is the way old msie versions work
		var style2 = document.all[showLayer].style;
		if (style2.display == "")
		{
			style2.display = style2.display? "":"none";
		}
		else
		{
			style2.display = style2.display? "":"block";
		}
	}
	else if (document.layers)
	{
	    alert('3');
		// this is the way nn4 works
		var style2 = document.layers[showLayer].style;
		if (style2.display == "")
		{
			style2.display = style2.display? "":"none";
		}
		else
		{
			style2.display = style2.display? "":"block";
		}
	}
}