function spClick(link1, afflink, provider)
{
    var str;
    var tmp = [];
    
    if (afflink != '')
    {
    	tmp.push(afflink);
    }
    else
    {
    	tmp.push(link1.href);
    }
	sid = location.href.indexOf("?sid=");
	if (sid != -1)
	{
		str = location.href.substring(sid+5);
		//tmp.push(link1.href);
		tmp.push("?sid=");
		tmp.push(str);
	}
	link1.href = tmp.join('');
	//if (provider == 'webhostingpad')
	//{
	//	alert ('Pay only $2.95 / mo on 2 yr plans\n Remember to use Coupon: SAVENOW');
	//}
	if (provider == 'justhost')
	{
		alert ('Get Another 20% Discount\n Remember to use Coupon: SPECIAL20off');
	}
	//alert(link1.href);
	return true;		
}

/*  wrote the following function because with just onClick, if you right click or middle click on firefox it will
not run, only left click is caught on onClick function, so then i just used onMouseUp event and used spClick function
but then the issue was when u left click in internet explorer and a alert message is shown in case of webhostingpad, the 
link is not followed. so basically i am using spClick function in case of left click with onClick event handler and 
rightclick function for all other clicks with onMouseUp event handler. Also never use onMouseDown it doesn't catch vareity of
clicks
*/

function rightClick(e, link1, afflink, provider)
{
    var str;
    var tmp = [];
	var clickType = 0;
	
	if (navigator.appName=="Microsoft Internet Explorer") 
	{
		clickType = e.button;
    }
    else 
    {
    	clickType=e.which;
    }
    
	if (clickType==1)
		return true;
			
    if (afflink != '')
    {
    	tmp.push(afflink);
    }
    else
    {
    	tmp.push(link1.href);
    }
	sid = location.href.indexOf("?sid=");
	if (sid != -1)
	{
		str = location.href.substring(sid+5);
		//tmp.push(link1.href);
		tmp.push("?sid=");
		tmp.push(str);
	}
	link1.href = tmp.join('');
	//if (provider == 'webhostingpad')
	//{
	//	alert ('Pay only $2.95 / mo on 2 yr plans\n Remember to use Coupon: SAVENOW');
	//}
	if (provider == 'justhost')
	{
		alert ('Get Another 20% Discount\n Remember to use Coupon: SPECIAL20off');
	}
	//alert(link1.href);
	return true;		
}

function spClick1(link1, afflink, provider)
{
    var str;
    var tmp = [];
    
    if (afflink != '')
    {
    	tmp.push(afflink);
    }
    else
    {
    	tmp.push(link1.href);
    }
	sid = location.href.indexOf("?sid=");
	if (sid != -1)
	{
		str = location.href.substring(sid+5);
		//tmp.push(link1.href);
		tmp.push("?sid=");
		tmp.push(str);
	}
	link1.href = tmp.join('');
	//if (provider == 'webhostingpad')
	//{
	//	alert ('Pay only $2.95 / mo on 2 yr plans\n Remember to use Coupon: SAVENOW');
	//}
	//if (provider == 'justhost')
	//{
	//	alert ('Get Another 20% Discount\n Remember to use Coupon: SPECIAL20off');
	//}
	//alert(link1.href);
	return true;		
}

/*  wrote the following function because with just onClick, if you right click or middle click on firefox it will
not run, only left click is caught on onClick function, so then i just used onMouseUp event and used spClick function
but then the issue was when u left click in internet explorer and a alert message is shown in case of webhostingpad, the 
link is not followed. so basically i am using spClick function in case of left click with onClick event handler and 
rightclick function for all other clicks with onMouseUp event handler. Also never use onMouseDown it doesn't catch vareity of
clicks
*/

function rightClick1(e, link1, afflink, provider)
{
    var str;
    var tmp = [];
	var clickType = 0;
	
	if (navigator.appName=="Microsoft Internet Explorer") 
	{
		clickType = e.button;
    }
    else 
    {
    	clickType=e.which;
    }
    
	if (clickType==1)
		return true;
			
    if (afflink != '')
    {
    	tmp.push(afflink);
    }
    else
    {
    	tmp.push(link1.href);
    }
	sid = location.href.indexOf("?sid=");
	if (sid != -1)
	{
		str = location.href.substring(sid+5);
		//tmp.push(link1.href);
		tmp.push("?sid=");
		tmp.push(str);
	}
	link1.href = tmp.join('');
	//if (provider == 'webhostingpad')
	//{
	//	alert ('Pay only $2.95 / mo on 2 yr plans\n Remember to use Coupon: SAVENOW');
	//}
	//if (provider == 'justhost')
	//{
	//	alert ('Get Another 20% Discount\n Remember to use Coupon: SPECIAL20off');
	//}
	//alert(link1.href);
	return true;		
}

function hostMessage ()
{
	alert ('We value the trust you are placing in us. If you are not 100% satisfied with HostMonster,\nplease get your refund and contact us on support@expertviews.org to get 1 year of free hosting');
	return true;
}
