/**************************************************************************************************************
Created by Madhosh on 20 Dec 2007 to detect the directory path based on the generic top-level domain
identified from the URL(.com, co.uk or .biz). Please note that this is to be used for the static HTML pages.
Calling the function Example: onClick="gototheURL('http://www.xyz','/index.htm');"
href="javascript:gototheURL('http://abc.xyz','');
***************************************************************************************************************/

var fullPath=(location.href); // stores the full URL filePath to the file
var rtnPath // The Retrun filePath
var topdomain // the top domain identified from the URL(.com, co.uk or .biz)
var subDomain // the sub domain passed (www.xyz or demo.xyz etc.,)
var filePath // the filePath to the file
		function gototheURL(subDomain,filePath) {
		//alert(fullPath);
		if (fullPath.match(".com")) {
			topdomain = ".com"
		} else if (fullPath.match(".co.uk")){
			topdomain = ".co.uk"
		} else if (fullPath.match(".biz")){
			topdomain = ".biz"
		} else {
			topdomain = ".com"
			}
			if (filePath=='') {
				rtnPath = subDomain+topdomain
			} else {
				rtnPath = subDomain+topdomain+filePath
			}
			//alert (rtnPath);
			document.location.href=rtnPath;			
		}


		function gotoBlankURL(subDomain,filePath) {
		//alert(fullPath);
		if (fullPath.match(".com")) {
			topdomain = ".com"
		} else if (fullPath.match(".co.uk")){
			topdomain = ".co.uk"
		} else if (fullPath.match(".biz")){
			topdomain = ".biz"
		} else {
			topdomain = ".com"
			}
			if (filePath=='') {
				rtnPath = subDomain+topdomain
			} else {
				rtnPath = subDomain+topdomain+filePath
			}
			//alert (rtnPath);
			//document.location.href=rtnPath;
		window.open(rtnPath);			
		}