function switchOn()
{
    document.getElementById('waiter').style.visibility='visible';
}
function switchOff()
{
    document.getElementById('waiter').style.visibility='hidden';
}

function popitup(url) {
	newwindow=window.open(url,'name','height=320,width=500');
	if (window.focus) {newwindow.focus()}
	return false;
}


Array.prototype.remove = function(from, to) 
{
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};
function vPlay2(string)
{
	var content = string.split("=");
	var s1 = new SWFObject('flash/player.swf','ply','470','320','9','#ffffff');
	s1.addParam('allowfullscreen','true');
	s1.addParam('allowscriptaccess','always');
	s1.addParam('wmode','opaque');
	s1.addParam('flashvars','file=files/'+content[1]);
	s1.write(content[0]);
}
function vPlay()
{
	var video = document.getElementById("vplayer").innerHTML;
	var s1 = new SWFObject('flash/player.swf','ply','470','320','9','#ffffff');
	s1.addParam('allowfullscreen','true');
	s1.addParam('allowscriptaccess','always');
	s1.addParam('wmode','opaque');
	s1.addParam('flashvars','file=files/'+video);
	s1.write('vplayer');
}
function PromptMe() 
{
	var stateVar = "home", displayDiv = document.getElementById("HistoryState"), ccounter = 1;
	var titleName = "";
	this.promtForNew = function(value,tempTitle)
	{
		var newVal = value;
		titleName = tempTitle + "";
		unFocus.History.addHistory(newVal);
	}
	this.historyListener = function(historyHash)
	{
		oldhistoryHash = stateVar;
		stateVar = historyHash;
	

			var searcher = historyHash.split("=");
			var searcher2 = historyHash.split("&");
			var searchss = "";
			var query = window.location.search.substring(1);
	
			if(titleName != "")
			  var titleName2 = titleName.split("=");
			else
			  var titleName2 = "";
		if(searcher[0] == "menu" && searcher[1]!="15")
		{
			ajaxpage('content.php?' + historyHash, 'content');
			setTimeout("vPlay()", 500);
		}
		if(searcher[0] == "menu" && searcher[1]=="15")
		{
			ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "contest")
		{
			ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "campaign")
		{
			ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "client")
		{
				ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "contactclient")
		{
			ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "news")
		{
			ajaxpage('content.php?' + historyHash, 'content');
		}
		if(searcher[0] == "fullnews")
		{
			ajaxpage('news.php?' + historyHash, 'white');
		}
		if(searcher2[1] == "vplay=1")
		{
			i=0
			while(i<searcher2.length)
			{
				if(i!=0)
					setTimeout("vPlay2('"+searcher2[i]+"')", 500);
				i++;
			}
			historyHash = oldhistoryHash;
		}
		if(searcher[0]=='' && oldhistoryHash == "home")
		{
			ajaxpage('content.php?menu=11', 'content');
			setTimeout("vPlay()", 500);
		}
	};
	unFocus.History.addEventListener('historyChange', this.historyListener);

	this.historyListener(unFocus.History.getCurrent());
	return false;
};
var demoApp;