// Cape-Town-Business JavaScript source

function pushDown(elm){
    elm.style.border = "inset";
}

function pushUp(elm){
    elm.style.border = "outset";
}

var bname = "";

var clickcnt = 0;	
function showHint(){
	if(clickcnt == 0){
		Effect.toggle('khint','appear');
		//hint = document.getElementById("khint");
		//hint.style.visibility = "visible";
	}
}	

function hideHint(){
	Effect.toggle('khint','appear');
	//hint = document.getElementById("khint");
	//hint.style.visibility = "hidden";
	clickcnt = 1;
	kw = document.getElementById("kwtt");
	kw.click();
}	

function showWarning(){
	Effect.toggle('warningCtrl','appear');
}

function GoTo(title,url)
{
     window.open(url,title,"height=500,width=600 ,titlebar=no,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no");
}

function checkConfig(){
	if(window.screen.width!=1024){
		warnScr = document.getElementById("warningCtrl");
		if(warnScr!=null){
			warnScr.innerHTML="For best viewing change your screen resolution to 1024x768"+
			'<div style="background-color:#FF6666;cursor:pointer;width:30px" onClick="showWarning();">OK</div>';
			document.getElementById("msghint").style.display = 'inline';
			document.getElementById("msghint").title = "1 message";
		}
	}
	
}

function imgPreLoad()
{ 

  var imgs = new Array("media/btnbcksel.jpg","media/btnbck.jpg","media/wtp1.jpg","media/wtp2.jpg","media/mail.jpg","images/tab_active_2.jpg", 
"images/tab_active_3.jpg", 
"images/tab_active_4.jpg", 
"images/tab_active_5.jpg",
"images/tab_hover_1.jpg",
"images/tab_hover_2.jpg",
"images/tab_hover_3.jpg",
"images/tab_hover_4.jpg",
"images/tab_hover_5.jpg",
"images/tab_normal_1.jpg",
"images/tab_normal_2.jpg",
"images/tab_normal_3.jpg",
"images/tab_normal_4.jpg",
"images/tab_normal_5.jpg",
"images/text_home_tab2.gif",
"images/text_home_tab3.gif",
"images/text_home_tab4.gif",
"images/text_home_tab5.gif");
  document.imageArray = new Array(imgs.length);
  for(var i=0; i<imgs.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = imgs[i];
  }
  checkConfig();
}

function doGoogle(){
	kw = document.getElementById("kwtt");
	if(kw.value.length==0){
		location.href = "#gsearch";
		return;
	}
	gfrm = document.getElementById("searchbox_001066875761859266762:91myiwoyhjc");
	gfrm.q.value = kw.value;
	gfrm.submit();
}

function showForum(ffrm){ 
	if(ffrm.forumid.value!=-1)
		ffrm.submit();
}

function submitBusFrm(){
	bname = document.getElementById("bname");	
	if(bname.value =="Enter Business name")
		bname.value = "";
	return true;	
}

function submitJobFrm(){
	jt = document.getElementById("jtitle");	
	if(jt.value =="Job Title")
		jt.value = "";
	return true;	
}

function submitCtbFrm(){
	kw = document.getElementById("kwtt");	
	if(kw.value =="Enter keywords")
		kw.value = "";
	return true;	
}

function cleanTxtOnFocus(elm,defval){
	if(elm.value == defval)
		elm.value = "";
}
