// JavaScript Document
function loadContent(url, div_id,eff_length){
	var loadingScript = "<table width='100%' height='350px'><tr><td align='center' valign='middle'><img src='images/loader.gif' /><br /><br />Loading. Please wait...</td></tr></table>"
	Effect.Fade(div_id, { duration: eff_length/1000 });
	document.getElementById(div_id).innerHTML = loadingScript;
	//setTimeout("Effect.Appear('"+div_id"', { duration: "+eff_length/1000+" })",eff_length);
	setTimeout("ajax('"+url+"', '"+div_id+"', 'fadein', "+eff_length/1000+")", eff_length);
	//ajax(url,div_id, 'fadein',eff_length/1000);
}
function mouseOver(id){
	var box = document.getElementById(id);
	if (box.src!='http://www.ravand.com/email/2/images/gift_selected.gif'){
		box.src='images/gift_hover.gif';
		box.style.cursor = "pointer";
		if(document.getElementById("choice").value==0){
			document.getElementById('msgBoard').innerHTML = updateBoard();
		}
	}
}
function mouseOut(id){
	var box = document.getElementById(id);
	if (box.src!='http://www.ravand.com/email/2/images/gift_selected.gif'){
		box.src='images/gift_inactive.gif';
		box.style.cursor = "default";
	}
}
function clicked(id) {
	var box=document.getElementById(id);
	var choice = document.getElementById("choice").value;
	if (choice==0){
		document.getElementById("choice").value=id; 
		box.src='images/gift_selected.gif';
		var pid = document.getElementById("playerID").value;
		document.getElementById('msgBoard').innerHTML = 'Nice choice! Remember, this is your only chance. To unselect, click on the box again. <a href="#" onClick="ajaxFadeOutIn(&quot;play3.cfm?b='+id+'&pid='+pid+'&quot;,&quot;playDiv&quot;,500); return false;"><b>Proceed with this box.</b></a>';
		for(var i=1;i<10;i++){
			if(i!=parseInt(id)){
				new Effect.Opacity(String(i), { from: 1.0, to: 0.5, duration: 0.4 });
			}
		}
	} else if (choice!=0 && choice==id) {
		box.src='images/gift_inactive.gif';
		document.getElementById("choice").value=0;
		for(var i=1;i<10;i++){
			if(i!=parseInt(id)){
				new Effect.Opacity(String(i), { from: 0.5, to: 1.0, duration: 0.4 });
			}
		}	
	} else {
		Effect.Shake(choice,{distance:5});
		document.getElementById('msgBoard').innerHTML = "You have already selected a gift! To deselect your choice, click on it again.";
	}
}
function updateBoard(){
	var msg = new Array();
	msg[1]="Oh btw, if you get dedicated hosting with PowerEdge 2850, you get free RAM upgrade!";
	msg[2]="Did you know that you can get 1U colocation for only $69.99/month? Crazy, isn't it?";
	msg[3]="Yes, it's true, Ravand offers 24/7 support, so you don't have to worry about anything!";
	msg[4]="Check this out: you get FREE 64bit Windows 2003 with PowerEdge 1950 hosting!";
	msg[5]="Check our website often for amazing promotions! I know you already do!";
	msg[6]="Want to get a discount on your dedicated hosting cost? Sign a 2 or 3-year contract!";
	msg[7]="Have total peace of mind. Rely on our powerful and reliable DELL and HP servers for your online business.";
	msg[8]="It's OK if you don't win the grand prize. The 'PowerEdge R200' hosting plan is now ON SALE!";
	msg[9]="Say what? You have a question? We're here to help! Call, send email or chat live!";
	msg[10]="Want to fully customize your server? Ravand offers you maximum flixbility with your server setup.";
	msg[11]="Did you know you can get a FREE domain name if you sign up for any of our dedicated hosting plans?";
	msg[12]="As one of our subscribers you get affordable, high quality, and super stable servers now with a discount!";
	msg[13]="Don't want the hassle of managing your server? No problem! We offer managed dedicated hosting too!";
	msg[14]="Aside from our world-class servers, we also offer the best web hosting software solutions too.";
	msg[15]="No need to worry, our premiere servers support both Linux and Windows based site hosting.";
	var rand = Math.floor((14-0)*Math.random()) + 1;
	return msg[rand];
}