﻿// JavaScript Document

var MASSignupURL = ''

function getMASSignupURL () {

	if (!MASSignupURL) {

		try {

			var objLocator = new ActiveXObject("QuickBooks.CoLocator");

			var obj = objLocator.Create("QBPrefs.Preferences");

			MASSignupURL = obj.MASSignUpUrl;

		} catch (e) { 

		}

	}

	if (!MASSignupURL) MASSignupURL = "https://merchantaccount.quickbooks.com/";

	return MASSignupURL

}

function go2Signup () {

	go(getMASSignupURL() + "j/mas/signup" + getSrcParam());

}


function go2Update () {

	go(getMASSignupURL() + "j/mas/update" + getSrcParam());

}

function go2UpdateTerminal () {

	go("http://www.quickbooksms.com/terminal/download/index.php" + getSrcParam());

}

function go2Features () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service/features.php" + getSrcParam());

}



function go2Pricing () {

	go("http://www.quickbooksmerchantservice.com/services/pricing.php" + getSrcParam());

}



function go2Apply () {

	go("http://www.quickbooksmerchantservice.com/services/apply.php" + getSrcParam());

}

function go2Activate () {

	go("http://www.quickbooksservices.com/activate2/index.php" + getSrcParam());
	
}


function go2Support () {

	go("http://www.quickbooksmerchantservice.com/services/support.php" + getSrcParam());

}



function go2Examples () {

	go("http://www.quickbooksmerchantservice.com/services/examples_at_work/index.php" + getSrcParam());

}



function go2Services () {

	go("http://www.quickbooksmerchantservice.com/services/services.php" + getSrcParam());

}



function go2MAS () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service/index.php" + getSrcParam());

}



function go2MASSupport () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service/support/index.php" + getSrcParam());

}



function go2POS () {

	go("http://www.quickbooksmerchantservice.com/services/POS_merchant_account_services/index.php" + getSrcParam());

}



function go2POSSupport () {

	go("http://www.quickbooksmerchantservice.com/services/POS_merchant_account_services/support/index.php" + getSrcParam());

}



function go2Terminal () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service_terminal/index.php" + getSrcParam());

}

function go2Web () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service_web/index.php" + getSrcParam());

}


function go2TerminalSupport () {

	go("http://www.quickbooksmerchantservice.com/services/merchant_service_terminal/user_guide.php" + getSrcParam());

}



function go2Demo () {

	go("http://www.quickbooksmerchantservice.com/services/demos.php" + getSrcParam());

}



function go2Home () {

	go("http://www.quickbooksmerchantservice.com/");

}



function go2Sitemap () {

	go("http://www.quickbooksmerchantservice.com/services/site_map.php");

}



function go2Sitehelp () {

	go("http://www.quickbooksmerchantservice.com/services/site_help.php");

}



function go2Quickbooks () {

	go("http://quickbooks.intuit.com/");

}



function go2Privacy () {

	go("http://www.quickbooksmerchantservice.com/privacy/");

}



function go2Legal () {

	go("http://quickbooks.intuit.com/commerce/catalog/fragments/quickbooks/common/legal.jhtml");

}



function go2ContactUs () {

	go("http://www.quickbooks.com/support/service/");

}



function getSrcParam () {

         var match = location.search.match(/(\?|&|%26)(src|p_prioritycode)=([-\w]+)/);

         return (match && match.length >= 4 && match[3]) ? '?p_prioritycode=' + match[3] : '';

}



function getSrcParam2 () {
	var match = location.search.match(/(\?|&|%26)src=([-\w]+)/);
	
	return (match && match.length >= 3 && match[2]) ? '?src=' + match[2] : '';
}



function getSrcParam_old () {

	var match = location.search.match(/(\?|&|%26)src=([-\w]+)/);

	return (match && match.length >= 3 && match[2]) ? '?p_prioritycode=' + match[2] : '';

}



function go (url) {

	window.location = url;

}



function MM_swapImgRestore() { //v3.0
		
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	
}


	
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}



function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}


		
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
