
function validate(form,fm_nm){var selected_id=form.selected_id.value;if(document.getElementById('user_id').value==false)
{window.location='index.php?option=com_comprofiler&task=registerComplete';return false;}
if(selected_id=="")
{alert("Please select "+fm_nm+". ");return false;}
return true;}
function validate_f(form,fm_nm){if(document.getElementById('user_id').value==false)
{window.location='index.php?option=com_comprofiler&task=registerComplete';return false;}
return true;}
function validate_player(form,fm_nm){var country=form.country.value;var selected_id=form.selected_id.value;if(document.getElementById('user_id').value==false)
{window.location='index.php?option=com_comprofiler&task=registerComplete';return false;}
if(country=="")
{alert("Please select Competition for "+fm_nm+". ");return false;}
if(selected_id=="")
{alert("Please select "+fm_nm+". ");return false;}
return true;}
function validate_result(form,fm_nm){var selected_id=form.selected_id.value;if(document.getElementById('user_id').value==false)
{window.location='index.php?option=com_comprofiler&task=registerComplete';return false;}
if(selected_id=="")
{alert("Please select Competitions.");return false;}
return true;}
function validate_photo_gallery(form,fm_nm){var selected_id=form.selected_id.value;if(document.getElementById('user_id').value==false)
{window.location='index.php?option=com_comprofiler&task=registerComplete';return false;}
if(selected_id=="")
{alert("Please select Competitions.");return false;}
return true;}
function validate_user_page(form,fm_nm){var page_color=form.page_color.value;var page_font=form.page_font.value;var page_background=form.page_background.value;if(page_color=="#585B62")
{alert("Please select Color for "+fm_nm+". ");return false;}
return true;}
var xmlHttp
function getPlayer(str)
{xmlHttp=GetXmlHttpObject()
document.getElementById("player_id").value="";if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="getplayer.php"
url=url+"?country="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
document.getElementById("playerdiv").innerHTML=xmlHttp.responseText;}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
var validategadget={};validategadget.validate_gadget=function()
{var errorflag=false;if(parseInt(document.gadget_rss_reader.display_items.value)>0){}
else
{alert('Display item must be greater than zero ');document.gadget_rss_reader.display_items.focus();return false;}
if(parseInt(document.gadget_rss_reader.reload_time.value)>0){}
else
{alert('Reload time must be greater than zero minutes');document.gadget_rss_reader.reload_time.focus();return false;}
if(document.gadget_rss_reader.rss_source.value=="")
{alert("Please insert Source URL.");}
if(document.gadget_rss_reader.rss_source.value!="")
{validategadget.validate_rssfeed(document.gadget_rss_reader.rss_source.value);}}
validategadget.filePath="readRSS.php";validategadget.validate_rssfeed=function(url)
{var params="q="+url+'&ActionType=check_rss_feed';var filePath=validategadget.filePath;validategadget.sendRequest(filePath,params);}
validategadget.sendRequest=function(filePath,params){if(window.XMLHttpRequest){var xmlhr=new XMLHttpRequest();}else{var xmlhr=new ActiveXObject('MSXML2.XMLHTTP.3.0');}
xmlhr.open('POST',filePath,true);xmlhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhr.onreadystatechange=function(){if(xmlhr.readyState==1){document.getElementById('validating').innerHTML='<font color="red">Validating...</b>';}else if(xmlhr.readyState==4&&xmlhr.status==200){if(xmlhr.responseText){document.getElementById('validating').innerHTML="";if(parseInt(xmlhr.responseText)>0)
{document.gadget_rss_reader.submit();}
else
{alert('Please enter valid rss feed. This contains no result');return false;}}}else if(xmlhr.readyState==4){alert('Invalid response received - Status: '+xmlhr.status);}}
xmlhr.send(params);}

function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop;}
else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}
else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}
else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}
coordinates.x=x;coordinates.y=y;return coordinates;}
function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false,use_css=false,use_layers=false;if(document.getElementById){use_gebi=true;}
else if(document.all){use_css=true;}
else if(document.layers){use_layers=true;}
if(use_gebi&&document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}
else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}
else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}
else if(use_layers){var found=0;for(var i=0;i<document.images.length;i++){if(document.images[i].name==anchorname){found=1;break;}}
if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}
x=document.anchors[i].x;y=document.anchors[i].y;}
else{coordinates.x=0;coordinates.y=0;return coordinates;}
coordinates.x=x;coordinates.y=y;return coordinates;}
function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;}
return ol;}
function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}
function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;}
return ot;}
function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}
function openColor(boxIndex,layer,anchorname,input_id)
{var colors=new Array("#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099","#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099","#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399","#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399","#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699","#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699","#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699","#FF66CC","#FF66FF","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999","#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999","#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999","#FF99CC","#FF99FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99","#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99","#FFCCCC","#FFCCFF","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99","#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99","#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFFFCC","#FFFFFF");var total=colors.length;var width=18;var content="";var content='<table border="0" cellspacing="2" cellpadding="0" bgcolor="#999999" '
content=content+'style="border:1px solid #FFFFFF;">';content=content+'<tr> <td align="center" style="color:#FFFFFF;"> Choose  Color</td><tr><tr><td align="center">';content=content+'<table width="50%"  border="0" cellspacing="0" cellpadding="2">';for(var i=0;i<total;i++){if((i%width)==0){content+="<TR>";}
content+='<TD align="center" valign="middle"><input type="button"  name="Submit" value=""  style="border:1px solid #FFFFFF; height:13px; width:13px;  background-color:'+colors[i]+';" onClick="change_color(\''+boxIndex+'\', \''+layer+'\' , \''+colors[i]+'\',\''+input_id+'\')"> </TD>';if(((i+1)>=total)||(((i+1)%width)==0)){content+="</TR>";}}
content=content+'</td></tr></table></table>';document.getElementById(layer).innerHTML=content;document.getElementById(layer).style.display='block';}
function change_color(id,closeid,color,input_id)
{document.getElementById(id).style.backgroundColor=color;document.getElementById(closeid).style.display='none';var col=color.substring(1);var val=document.getElementById(input_id).value=col;}
x=350;y=100;function setVisible(obj)
{obj=document.getElementById(obj);obj.style.display=(obj.style.display=='none')?'inline':'none';setTimeout("placeIt('layer1')",500);}
function placeIt(obj)
{obj=document.getElementById(obj);if(document.documentElement)
{theLeft=document.documentElement.scrollLeft;theTop=document.documentElement.scrollTop;}
else if(document.body)
{theLeft=document.body.scrollLeft;theTop=document.body.scrollTop;}
theLeft+=x;theTop+=y;obj.style.left=theLeft+'px';obj.style.top=theTop+'px';setTimeout("placeIt('layer1')",500);}