
//------------------------------------------------------------------------------------>
function bookmark(url, description)
{
	netscape="Netscape User's hit CTRL+D on your keyboard to add a bookmark to this site."
	if (navigator.appName=='Microsoft Internet Explorer')
	{
		window.external.AddFavorite(url, description);
	}
	else if (navigator.appName=='Netscape')
	{
		alert(netscape);
	}
}

//------------------------------------------------------------------------------------>
function GoTo(url)
{
	top.location.href=url;
}

//------------------------------------------------------------------------------------>
function CheckImgEx(id) 
{
	var filename = new String();
		
	//Get file name
	if(GBI(id))
	{
		filename = String(GBI(id).value);
	}
	
	if (!filename)
	{
		alert('Please select an image file from your computer by clicking the "Browse" button. \n Then click the "Upload Picture button"');
		return false;
	}
	
	filename = filename.substring(filename.lastIndexOf('.',0), filename.length - filename.lastIndexOf('.',0));
	filename = filename.toLocaleLowerCase();
	if(filename != '.gif' && filename != '.jpg' && filename != '.jpeg' && filename != '.png')
	{
		alert("Please only upload image files width EXTENSION of .gif, jpg, jpeg, bmp and png" );
		return false;
	}
	
	return true;
	
} 

//------------------------------------------------------------------------------------>
function GBI(id)
{		   
	return docuemnt.getElementById(id);
}
function Confirm(contentCtrl)
{
	var popup= contentCtrl;
	
//	if(GBI('ConfirmPopup'))
//	{
//		popup = GBI('ConfirmPopup');
//	}
//	else
//	{
//		popup = document.createElement("div");	
//		popup.id = 'ConfirmPopup';
//		popup.className = 'dialogShow';
//		document.body.appendChild(popup);
//	}
//	popup.style.display = 'block';
//	popup.innerHTML = '<div class="shadow1"><div class="shadow2"><div class="shadow3"><div class="container">' + contentCtrl.innerHTML + '</div></div></div></div>';
	popup.style.display = 'block';
	popup.style.position = 'absolute';
	//popup.className = 'dialogShow';
	popup.style.top = (document.body.clientHeight/2)  - (popup.offsetHeight/2)+ 'px';
	popup.style.left = (document.body.clientWidth/2)  - (popup.offsetWidth/2)+ 'px';
}
function CloseConfirm(contentCtrl)
{
	var popup = contentCtrl;//GBI('ConfirmPopup');
	popup.style.display = 'none';//contentCtrl.innerHTML = popup.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].outerHTML;	 
	//GBI('ConfirmPopup').parentNode.removeChild(GBI('ConfirmPopup'));

}
function showhide(id)
{
	var ctrl = GBI(id);
	if(ctrl && ctrl.className == 'shown')
	{
		ctrl.className = 'hidden';
	}
	else
	{
		ctrl.className = 'shown';
	}
}
function SelectText(ctrl)
{
	if(!ctrl)return;
	ctrl.select();
	return true;
	
}
function ShowCommentInput(ctrl)
{
	if(!CheckLogin())
	{
		alert('You need to login to make comments');
		return false;
	}
	
	if(ctrl)
	{
		var nextCtrl = ctrl.parentNode.nextSibling;
		while (nextCtrl.nodeType == 3) 
		{ 
			// Fix for Mozilla/FireFox Empty Space becomes a TextNode 
			nextCtrl = nextCtrl.nextSibling;
		}
				
		if(nextCtrl.style.display == 'block')
		{
			nextCtrl.style.display = 'none';
		}
		else
		{
			nextCtrl.style.display = 'block';
		}
	}
	return true;
}
function HideCommentInput(ctrl)
{
	if(ctrl)
	{
		ctrl = ctrl.parentNode;
				
		if(ctrl.style.display == 'block')
		{
			ctrl.style.display = 'none';
		}
		else
		{
			ctrl.style.display = 'block';
		}
	}
	return true;
}
String.prototype.trim = function() { return this.replace(/^\s*/, "").replace(/\s*$/, "");};

