var G_URL;
G_URL = '';
var G_fobj;
 var b;
/*
*  for general use
*  
*
*/ 
function TrackingBt(argBtName,argDriveItem,argTrackingType){ 
	var strsource,url;
	idx = Math.round(Math.random()*10000); 
	url = document.location.href;
 
	if (url.indexOf('?') < 0)
		PageURL = url
	else
		PageURL = url.substring(0,url.indexOf('?'));

 
	if (PageURL.indexOf('#') > 0)
		PageURL= url.replace('#','*');
 
    PageItem = document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1);
 
 
	PageTitle = escape(document.title);
	strsource = 'media.asp?PageItem=' + PageItem + '&PageTitle=' +PageTitle + '&PageURL=' + PageURL + '&BtName=' +argBtName + '&DriveItem=' +argDriveItem + '&TrackingType='+argTrackingType + '&idx=' + idx;
 	document.getElementById('Tracking').src = strsource; 	
 	return true;
}
/*
*  tracking for <a href='' onclick=''> no target self page skip
*
*
*
*/
function TrackingBtAdv(argBtName,argDriveItem,argTrackingType,locationURL){ 
	var strsource,url;
	idx = Math.round(Math.random()*10000); 
	url = document.location.href;
 
	if (url.indexOf('?') < 0)
		PageURL = url
	else
		PageURL = url.substring(0,url.indexOf('?'));

 
	if (PageURL.indexOf('#') > 0)
		PageURL= url.replace('#','*');
 
    PageItem = document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1);
 
 
	PageTitle = escape(document.title);
	strsource = 'media.asp?PageItem=' + PageItem + '&PageTitle=' +PageTitle + '&PageURL=' + PageURL + '&BtName=' +argBtName + '&DriveItem=' +argDriveItem + '&TrackingType='+argTrackingType + '&idx=' + idx;
 	document.getElementById('Tracking').src = strsource;
 	if(argTrackingType == "P")
 	{
 	    return true;
 	}else
 	{
 	    setTimeout("location.href='" + locationURL + "'",100); 	     	    
 	}
 	
}
	
	 
	
function TrackingButton(argBtName,argDriveItem,argTrackingType){ 
	 
	var strsource,url;
	idx = Math.round(Math.random()*10000); 
	url = document.location.href;
	if (url.indexOf('?') < 0)
		PageURL = url
	else
		PageURL = url.substring(0,url.indexOf('?'));
		
		if (PageURL.indexOf('#') > 0)
		PageURL= url.replace('#','*');
		
    PageItem = document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1);
	PageTitle = escape(document.title);
	strsource = 'media1.asp?PageItem=' + PageItem + '&PageTitle=' +PageTitle + '&PageURL=' + PageURL + '&BtName=' +argBtName + '&DriveItem=' +argDriveItem + '&TrackingType='+argTrackingType + '&idx=' + idx;
    // 	document.all.Tracking.src = strsource;
 	 
    formsubmit(strsource,'buttontracking');
    document.form1.submit();
   
}

function TrackingButton1(argBtName,argDriveItem,argTrackingType){ 
	 
	var strsource,url;
	idx = Math.round(Math.random()*10000); 
	url = document.location.href;
	if (url.indexOf('?') < 0)
		PageURL = url
	else
		PageURL = url.substring(0,url.indexOf('?'));
		
	if (PageURL.indexOf('#') > 0)
		PageURL= url.replace('#','*');
		
    PageItem = document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1);
	PageTitle = escape(document.title);
	strsource = 'media2.asp?PageItem=' + PageItem + '&PageTitle=' +PageTitle + '&PageURL=' + PageURL + '&BtName=' +argBtName + '&DriveItem=' +argDriveItem + '&TrackingType='+argTrackingType + '&idx=' + idx;
    formsubmit(strsource,'buttontracking');
    document.form1.submit();
}
	
	
function formsubmit(action,target){
 
	document.form1.action=action;
    document.form1.method='post';
	document.form1.target=target;
}
	 
document.onclick  = onclickHandler;
	
function onclickHandler(eventTag){
var event=eventTag||window.event;
		 obj = event.srcElement ? event.srcElement : event.target;
		 G_fobj = obj
		 
			if (obj.BtName){
			
				BtName = obj.BtName;
				if (obj.GURL){
					G_URL =obj.GURL
				}
				
				if (obj.DriveItem){
					DriveItem = obj.DriveItem
				}else{
					DriveItem = ''
				}
				TrackingType  = 'I'
				TrackingBt(BtName,DriveItem,TrackingType);
				if (obj.flag){
				event.returnValue = true;
					}else{
				event.returnValue = false;
				}
			}else{
			
				event.returnValue = true;
				
			} 
			
		 
	}
	
		document.write('<img src="" width=0 height=0 ID=Tracking >')
		
		document.getElementById('Tracking').onreadystatechange = function(){
			if (document.getElementById('Tracking').readyState == 'loading'){
				if (G_URL != ''){
					 if (G_URL !="#"){
						tempvalue = G_URL;
						G_URL = '';
						location.href = tempvalue ;
					}
				}else{
					if (G_fobj){ 
						if (G_fobj.type == 'image' || G_fobj.type == 'submit' || G_fobj.type == 'select-one'){
						if(G_fobj.form)
						{
							//G_fobj.form.submit();
							}
						}
					}
					
				}
			}
		} 
		 
	