//Source of the user
var strSource;

// var NormalString =/^[^\;\'\[\]\(\)\&\?\!\%\<\>\"\&\=]+$/;

var NormalString =/^[^\;\'\[\]\(\)\!\<\>\"]+$/;

//alert(escape(document.location.href))

strSource= (document.location.href);

if (strSource.indexOf("#") > 0)

	strSource = strSource.substring(0, strSource.indexOf("#"));

if (strSource.indexOf("?") > 0)

	strSource = strSource.substring(strSource.indexOf("?"), strSource.length);

else

	strSource='';	

isProper(unescape(strSource))


function fnSubmit(strPath){
	if (strSource != '') 

	{
		if (strPath.indexOf("#") > 0) 
		{
		//document.location.href=  strPath + strSource;

		strSource=strSource+'#';
		document.location.href=  strPath.replace('#',strSource);
		strNavPromo=strSource;

		}

		else

		{		
			document.location.href= strPath +  strSource;		
		}
	}

	else
	{
		document.location.href= strPath;
		strNavPromo='';

	}
}	
function isProper(objectToCheck) 
	{	
		var obj = objectToCheck;
		var string=obj;
		if (string!='' || string.length!=0)
		{
			if (NormalString.test(string))
				return true;
			else
				{
					//return false;
					document.location.href = '/ipb/europe/errorpage/'
				}
		}
		return true;
	}	
///- END 

//footer
//source tracking

for (i=0;i<document.links.length;i++) {

var strHref = (document.links[i].href).toLowerCase();

    if ( ((strHref.substring(0,11)).toLowerCase()== 'javascript:') ||(strHref.indexOf("history")>0 || (strHref.indexOf("#")>0) || ((strHref.substring(0,7)).toLowerCase()== 'mailto:')))

	{}

	else

	if (document.links[i].hostname == location.hostname){

		if(strHref.indexOf("?")>0) 

			if(strHref.indexOf("gohttps")>0)

				document.links[i].href=document.links[i].href + strSource 

			else		

				document.links[i].href=document.links[i].href + strSource.replace("?","&")

			else

				document.links[i].href=document.links[i].href + strSource
				
			
			function gup(name) {
  				name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
 		 		var regexS = "[\\?&]"+name+"=([^&#]*)";
 		 		var regex = new RegExp( regexS );
 		 		var results = regex.exec( window.location.href );
  				if( results == null )
   		 			return "";
  					else
    				return results[1];
				}
				icid_param = gup('icid');
				source_param = gup('source');
					if (icid_param.length>0 )
					{
						strSource="?source="+source_param;
					}		
					if(source_param.length==0 )
					{
						strSource="";
					}
			
		}
}
	
	


