// JavaScript Document
var isUSA = false;
function checkifUSA()
{ //www.fx-auto-usa.com
	var winLoc = String(window.location);
	var test = winLoc.search(/fx-auto-usa/i);
	if (test != -1) { 
		isUSA = true;
	}
} 
function showIframe() {
	var iDiv = document.getElementById("iframeDiv").style;
	var iPHDiv = document.getElementById("iframePlaceholder").style;
	iDiv.left = iPHDiv.left;
	iDiv.top = iPHDiv.top;
	iDiv.visibility = "visible";
	iDiv.display = "block";
}
function mail(to){
	window.location = "mailto:"+to+"@fx-auto.com";
	return;
}
function init() {
	checkifUSA();
	if (isUSA) {
		document.getElementById("USAtext").style.visibility = "hidden";
		document.getElementById("USAtext").style.display = "none";
		
	}
}

function Become() {
    var ver = getInternetExplorerVersion();
    var contantDiv = document.getElementById("become");
    if (isUSA) {
        if (ver >= 8.0) {
            document.getElementById('become').style.display = "none";
            document.getElementById('becomeAmerica').cellSpacing = "6";
        }
        else {
            document.getElementById('become').style.display = "none";
            document.getElementById('becomeAmerica').cellSpacing = "5";
        }
    }
    else {
        document.getElementById('become').style.display = "inline";
        
        
    }
}

function ISIE() {
    var ver = getInternetExplorerVersion();
    var IsEI = navigator.appName.indexOf("Explorer") != -1 ? 1 : 0;
    if (IsEI == 1) {
        if (ver >= 8.0) {
            document.getElementById('tdspace').style.height = "30px";
        }
        else {
            document.getElementById('tdspace').style.height = "40px";
        }
    }
    else {
        document.getElementById('tdspace').style.height = "30px";
    }
}



function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}


function ChangeFilePDF()
{
    init();
    if (isUSA) {
        document.getElementById("PDF").href = "Files/LLC FSS LOD.pdf";
    } else {
        document.getElementById("PDF").href = "Files/Ltd Service Provider LOD.pdf";
    }
}


function ChangeIframeURL()
{
    init();
    if (isUSA) {
        document.getElementById("URL").src = "https://secure2.fxcorporate.com/fxtr/?ib=Tradency_Affiliate";
    } else {
        document.getElementById("URL").src = "https://secure2.fxcorporate.com/fxtr/?ib=fss_uk_aff";
    }

}

//window.onDomReady(init);