// JavaScript Document

var current = "";
function PS(img_id, imageRoot, allowEditor){
	if(!document.getElementById) return false;
	if (current == "") current = img_id;
	
	var img = document.getElementById("img"+img_id);
	var cimg = document.getElementById("img"+current);
	var div = document.getElementById("categoryContent_main"+img_id);
	var cdiv = document.getElementById("categoryContent_main"+current);
	//.style.background='url(images/m'+current+'.gif) no-repeat';
	cimg.style.background='url(' + imageRoot + 'upd-'+current+'.gif) no-repeat';
	img.style.background='url(' + imageRoot + 'upds-'+img_id+'.gif) no-repeat';
	cdiv.style.display = "none";
	div.style.display = "block";
	current = img_id;
	$("input:[name='uploadOptions']").val([current]);
	if (allowEditor == "Text"){
	    $('#editorRadio').removeAttr("disabled"); 
	} else {
	    $('#editorRadio').attr("disabled", true); 
	}
    updateControls('file');
    $("input:[name='uploadType']").val(['file']);
}

function showList()
{
	document.getElementById('list').style.display = 'block';
}

function showListGeo(){
	document.getElementById('listgeo').style.display = 'block';
}

function hideList(id)
{
	document.getElementById('list').style.display = 'none';
	if(id==1){
		document.getElementById('selectboxP').innerHTML='Search';
	}
}

function editDetails()
{
	document.getElementById('profileDet').innerHTML = '<input onfocus="if (this.value==\'Name of the Participant\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'Name of the Participant\';" type="text" class="textbox_profileB" value="Name of the Participant" /><br /><input onfocus="if (this.value==\'22 years, Male\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'22 years, Male\';" type="text" class="textbox_profile" value="22 years, Male" /><br /><input onfocus="if (this.value==\'City, State.\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'City, State.\';" type="text" class="textbox_profile" value="City, State." /><br /><input onfocus="if (this.value==\'email ID of the participant here\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'email ID of the participant here\';" type="text" class="textbox_profile" value="email ID of the participant here" /><br /><input name="" type="submit" value="Save changes" />';
}

function editSubDetails1()
{
	document.getElementById('subDetails1').innerHTML = '<img src="images/uploadMenu_profile.gif" width="136" height="11" border="0" usemap="#Map" class="float" /><map name="Map" id="Map"><area shape="rect" coords="1,-1,28,10" href="#" /><area shape="rect" coords="39,0,92,9" href="#" /><area onclick="editSubDetails(1)" shape="rect" coords="103,0,132,10" href="#" /></map><b class="font_12">TITLE: <input onfocus="if (this.value==\'Of the entry\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'Of the entry\';" class="textbox_profileB1" type="text" value="Of the entry" /> - CATEGORY</b><br /><p>Description:<textarea class="textarea" onfocus="if (this.value==\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\';">The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.</textarea><br /><input name="" type="submit" value="Save changes" /></p>';
}

function editSubDetails2()
{
	document.getElementById('subDetails2').innerHTML = '<img src="images/uploadMenu_profile.gif" width="136" height="11" border="0" usemap="#Map1" class="float" /><map name="Map1" id="Map1"><area shape="rect" coords="0,0,28,10" href="#" /><area shape="rect" coords="40,-4,92,10" href="#" /><area onclick="editSubDetails2()" shape="rect" coords="103,-1,134,10" href="#" /></map><b class="font_12">TITLE: <input onfocus="if (this.value==\'Of the entry\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'Of the entry\';" class="textbox_profileB1" type="text" value="Of the entry" /> - CATEGORY</b><br /><p>Description:<textarea class="textarea" onfocus="if (this.value==\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\';">The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.</textarea><br /><input name="" type="submit" value="Save changes" /></p>';
}

function editSubDetails3()
{
	document.getElementById('subDetails3').innerHTML = '<img src="images/uploadMenu_profile.gif" width="136" height="11" border="0" usemap="#Map2" class="float" /><map name="Map2" id="Map2"><area shape="rect" coords="0,0,28,10" href="#" /><area shape="rect" coords="40,-4,92,10" href="#" /><area onclick="editSubDetails3()" shape="rect" coords="103,-1,134,10" href="#" /></map><b class="font_12">TITLE: <input onfocus="if (this.value==\'Of the entry\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'Of the entry\';" class="textbox_profileB1" type="text" value="Of the entry" /> - CATEGORY</b><br /><p>Description:<textarea class="textarea" onfocus="if (this.value==\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\';">The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.</textarea><br /><input name="" type="submit" value="Save changes" /></p>';
}

function editSubDetails4()
{
	document.getElementById('subDetails4').innerHTML = '<img src="images/uploadMenu_profile.gif" width="136" height="11" border="0" usemap="#Map3" class="float" /><map name="Map3" id="Map3"><area shape="rect" coords="0,0,28,10" href="#" /><area shape="rect" coords="40,-4,92,10" href="#" /><area onclick="editSubDetails4()" shape="rect" coords="103,-1,134,10" href="#" /></map><b class="font_12">TITLE: <input onfocus="if (this.value==\'Of the entry\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'Of the entry\';" class="textbox_profileB1" type="text" value="Of the entry" /> - CATEGORY</b><br /><p>Description:<textarea class="textarea" onfocus="if (this.value==\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\')this.value=\'\';" onblur="if (this.value==\'\')this.value=\'The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.\';">The entire paragraph of description as the participant would have entered on the Registration Page. The entire paragraph of description as the participant would have entered on the Registration Page.</textarea><br /><input name="" type="submit" value="Save changes" /></p>';
}



function showList1(id)
{
	document.getElementById('listReg'+id).style.display = 'block';
}

function hideList1(id)
{
	document.getElementById('listReg1').style.display = 'none';
	if(id==1){
		document.getElementById('selectReg1').innerHTML='Search';
	}
}

function hideList2(id)
{
	document.getElementById('listReg2').style.display = 'none';
	if(id==1){
		document.getElementById('selectReg2').innerHTML='Above 14yrs.';
	}
}


function hideList3(id)
{
	document.getElementById('listReg3').style.display = 'none';
	if(id==1){
		document.getElementById('selectReg3').innerHTML='Search';
	}
}

function hideList4(id)
{
	document.getElementById('listReg4').style.display = 'none';
	if(id==1){
		document.getElementById('selectReg4').innerHTML='40$';
	}
}


currCategory=1;
function shiftCategory(id){
	document.getElementById('categoryContent_main'+id).style.display = 'block';
	document.getElementById('categoryContent_main'+currCategory).style.display = 'none';
	
	var curCategory_image = '../images/category'+currCategory+'.gif';
	document.getElementById('category'+currCategory).src = "curCategory_image";
}

var div_id;
var current1 = "1";
function default_flip(div_id)
{
	 if(div_id == 5)
	 {
		 var div1 = document.getElementById("introImage5");
		 var curDiv1 = document.getElementById("introImage" + current1);
		 div1.style.display = "block";
		 curDiv1.style.display = "none";
		 div_id = 5;
	 }
	 if(div_id <= 4 && div_id != 1)
	 {
	 	var div1 = document.getElementById("introImage" + div_id);
		var curDiv1 = document.getElementById("introImage" + current1);
	 	curDiv1.style.display = "none";
	 	div1.style.display = "block";
	 }
	 
	 current1 = div_id;
	 div_id ++;
	 timer = setTimeout("default_flip("+ div_id +")", 5000);
}