// JavaScript Document
var message="Copyright 2009 Gaballi.com. \r\rContents of this web site may not be used without written permission of Gaballi.";
///////////////////////////////////
function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;
	}
}
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}
if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
// --> 

var showDateShort = 1;
var showDate= 2;
var showDateTime= 3;
var showTime= 4;
function ShowDateTime(dateStyle){
	var today = new Date();
	var dStr = "";
	switch (dateStyle){
		case showDateShort:
			dStr = today.toDateString();
		break;
		case showDateTime:
			dStr = today.toLocaleString();
		break;
		case showTime:
			dStr = today.toLocaleTimeString();
		break;
		case showDate:
		default:
			dStr = today.toLocaleDateString();
		break;
	}
	document.write(dStr);
}
function ps_func(id){
   if(id != 'opportunities')
   document.getElementById('submenu_opportunities').style.display='none';
   if(id != 'classifieds')
   document.getElementById('submenu_classifieds').style.display='none';
   if(id != 'testimonials')
   document.getElementById('submenu_testimonials').style.display='none';
   if(document.getElementById('submenu_'+id)){
    document.getElementById('fill').style.display='none';
    document.getElementById('submenu_'+id).style.display='';
   }else{
    document.getElementById('fill').style.display='';
   }
}
function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}
function gb_sub_cat_change(id){
	var el = getElementsByClass('gb_sub_cat_table', document, 'table');
	for(i=0;i<el.length;i++){
		if(el[i].id == id || id == "All"){
			el[i].style.display='';
		}else{
			el[i].style.display='none';
		}
	}
}
function gb_change_all(cls,id,tag){
	var el = getElementsByClass(cls, document, tag);
	for(i=0;i<el.length;i++){
		if(el[i].id == id || id == "All"){
			el[i].style.display='';
		}else{
			el[i].style.display='none';
		}
	}
}

function showRegions(id){
	for(i=0;i<5;i++){
		if(i==id){
			document.getElementById('region_sub_'+i).style.display='';
		}else{
			document.getElementById('region_sub_'+i).style.display='none';
		}
	}
}
function PS_popup(url,w,h) {
  if(w == 'undefined' || w == null || w == 'null'){
	w = 400;  
  }
  if(h == 'undefined' || h == null || h == 'null'){
	h = 400;  
  }
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h+',screenX=300,screenY=300,top=150,left=150');
}




