//Copyright 2006 Adobe Systems, Inc. All rights reserved.
//
//This is the base class for implementing an Active Content extension -- a piece of code that knows how to rewrite OBJECT tags so that they comply to the Eolas patent without making the browser display the "Press OK to continue loading the content of this page" message box.
//
// When the user hovers the mouse over an ActiveX control in Internet Explorer 6 updated with (April 2006) Cumulative Security Update (912812) or Internet Explorer 7, the following message is displayed:
// “Press Spacebar or Enter to activate and use this control.”
// The user can now click the mouse anywhere inside the ActiveX control area, or press the Spacebar or Enter key to activate the control.
// The standard.js file has been introduced to retain the earlier behavior where the control remains interactive from the first click to the last.

function writeDocument(s){document.write(s);}

function swapFlash(){
	if($('homeContent').style.display=='none'){

		$('homeContent').style.display='block';
		$('mplayer').style.height='125px';
	} else {
		$('homeContent').style.display='none';
		$('mplayer').style.height='250px';

	}
}

function loadFlash(){
writeDocument('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" ID="Captivate1">'+
  '<param name="movie" value="deflash/GameCP Demo_custom.swf">'+
  '<param name="quality" value="high">'+
  '<param name="loop" value="1">'+
  '<param NAME="wmode" VALUE="transparent">'+
  '<embed src="deflash/GameCP Demo_custom.swf" width="100%" height="125" loop="0" quality="high" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" id="mplayer" wmode="transparent"></embed>'+
  '</object>');


}
function submitnews(){

var email=$('newsLetterform').email.value;

if(!email || email == "user@email.com"){
	alert("Please insert an e-mail address.");
	$('newsLetterform').email.focus();
	return false;
}


if(!$('check1').checked && !$('check2').checked){
	alert("Please select atleast one list.");
	return false;

}

new Ajax.Request('http://gamecp.com/list/?p=subscribe&id=2', {
  parameters: $('newsLetterform').serialize(true),
    onSuccess: function(transport){
      var response = transport.responseText || "Thank you for subscribing to our lists.";
      $('newssignup').innerHTML = 'Check your e-mail! You will need to confirm that you want to subscribe to the GameCP notifications.';
    },
    onFailure: function(){ $('newssignup').innerHTML = 'We were unable to process your request.<br/>'+$('newssignup').innerHTML; }



  });


}
function determinPosition(e){
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	return posx;
}


function demoAPos(e) {
	var posx=determinPosition(e);
	$('demoA').style.marginLeft=posx-48+'px';
	Effect.toggle('demoA','appear');
	$('demoB').style.display='none';
	$('downloadA').style.display='none';
	$('downloadB').style.display='none';
	return false;
}
function downloadAPos(e) {
	var posx=determinPosition(e);
	$('downloadA').style.marginLeft=posx-48+'px';
	Effect.toggle('downloadA','appear');
	$('demoA').style.display='none';
	$('demoB').style.display='none';
	$('downloadB').style.display='none';

	return false;

}

function demoBPos(e) {
	var posx=determinPosition(e);
	$('demoB').style.marginLeft=posx-48+'px';
	Effect.toggle('demoB','appear');
	$('demoA').style.display='none';
	$('downloadA').style.display='none';
	$('downloadB').style.display='none';
	return false;
}
function downloadBPos(e) {
	var posx=determinPosition(e);
	$('downloadB').style.marginLeft=posx-48+'px';
	Effect.toggle('downloadB','appear');
	$('demoA').style.display='none';
	$('demoB').style.display='none';
	$('downloadA').style.display='none';
	return false;

}



function submitValid(as,df){

if(as == true){
	

new Ajax.Request('index.php', {
  parameters: $('contactofmr').serialize(true),
    onSuccess: function(transport){
	 var form=$('contactofmr');
      var response = transport.responseText || "Thank you for subscribing to our lists.";
      $('contactContent').innerHTML = 'Thanks for contacting GameCP, '+form['yourname'].value +'!<br/>We will reply to you within 24 hours.<br/>Please visit the <a href="irc://irc.gamecp.com/help">IRC Network</a> for live support.';
    },
    onFailure: function(){ $('contactContent').innerHTML = 'We were unable to process your request.<br/>'+$('contactContent').innerHTML; }



  });









}
return false;

}



function launchdemo(url, t) {
window.open(url, t, 'width=640,height=400,left=520,top=325, scrollbars=1');
return true;
}
