﻿function conf(text,url){
	if (confirm(text))
		location.href=url;
}


function changeName(object,option1,option2){
	//alert(object);
	var Obj = document.getElementById(object)
	if(Obj==null)
		Obj=option1;
	//alert(Obj);
	Obj.innerHTML=Obj.innerHTML==option1 ? option2 : option1;
}


function show_hide(Element){
	//alert(Element);
	var Obj = document.getElementById(Element)
	if(Obj==null)
		Obj=Element;
	//alert(Obj);
	Obj.style.display=Obj.style.display=="none" ? "" : "none";
}


function SetPage(page_num,links,dir){
	if (page_num == -1)
		if (dir != 1){location.href=('?numofrec=99999&'+links)}else{location.href=(links+'/0')}
	else
		if (dir != 1){location.href=('?page='+page_num+'&'+links)}else{location.href=(links+'/'+page_num)}
}


function addFav(){
  if (document.all)
    window.external.AddFavorite(C_Site_URL, META_Description);
  else if (window.sidebar)
    window.sidebar.addPanel(META_Description, C_Site_URL, "")
}

function MaxLength(obj,max){
	if(obj.length>=max){
		alert(max+' chars maximum!');
		event.returnValue = false;
	}
}


function vote(formObj){
	
	var el_collection = formObj.VOTE_Poll_Id
	
	var foundCheck = false
			
	for (c=0;c<el_collection.length;c++)
		if (el_collection[c].checked)
			foundCheck = true

	if(foundCheck)
		formObj.submit();
	else
		alert(formObj.attributes["badMsg"].nodeValue)
}

//---[ Rank Functions ]----------------------------------------------------------------------------------------------------

function RankOnOver(id,pointer){
	for(r=1;r<=pointer;r++){
		document.getElementById('star_'+r+'_'+id).src='/unique/images/star_over.gif'
	}
}

function RankOnOut(id,pointer,rank){
	for(r=1;r<=pointer;r++){
		if(r<=rank)
			document.getElementById('star_'+r+'_'+id).src='/unique/images/star_locked.gif'
		else
			document.getElementById('star_'+r+'_'+id).src='/unique/images/star_blank.gif'
	}
}

function RankRec(id,rank){
	RankDisallow(id);
	theIframe.location.href='/site_handler.asp?rid='+id+'&rank='+rank;
}

function RankDisallow(id){
	for(r=1;r<6;r++){
		curStarObj = document.getElementById('star_'+r+'_'+id);
		curStarObj.onmouseout=null;
		curStarObj.onmouseover=null;
		curStarObj.onclick=null;
		curStarObj.style.cursor='default';
	}
}

//-------------------------------------------------------------------------------------------------------------
