var adiqPopupLoaded = false;

function showPopup()
{
	var div = $('adiqPopups');
	if (!adiqPopupLoaded)
	{
		adiqPopupLoaded = true;
		div.insert({ 'bottom': '<iframe id="adiqRemoteFrame" scrolling="no" allowtransparency="true" width="100%" height="100%" src="' + document.location.protocol + '//click.adiqglobal.com/AU/mondial/callbackInfo.php" frameborder="0" ></iframe>' });
	}

	div.setStyle({ display: 'block' });
	
	//if browser is Firfox apply these styles to the pages
	if (Prototype.Browser.Gecko)
	{

		div.setStyle({ width: '473px' });
		div.setStyle({ height: '262px' });	
	//else if browser is Chrome or Safari apply these styles to the pages
	}
	else if(Prototype.Browser.WebKit){

		div.setStyle({ width: '473px' });
		div.setStyle({ height: '262px' });
	}
}

function hidePopup(){
	
	$('adiqPopups').setStyle({display: 'none'});
}

function formatFormPanel(formType){
	
	//if the consumer is submitting an sms apply these changes
	if(formType == 'sms'){
		
		//if browser is Firfox apply these styles to the pages
		if(Prototype.Browser.Gecko){
			
			$('adiqFormPanel').setStyle({top: '155px'});
			//$('adiqFooter').setStyle({top: '98px'});
		
		//else if browser is Chrome or Safari apply these styles to the pages
		}else if(Prototype.Browser.WebKit){
			
			$('adiqFormPanel').setStyle({left: '220px'});
			$('adiqFormPanel').setStyle({top: '155px'});
			
		
		//else apply these styles for IE support
		}else{
			//$('adiqFormPanel').style.cssText = 'left: 35px';
		}
	}
	
	//if the consumer is submitting a nearest apply these changes
	if(formType == 'nearest'){
		
		//if browser is Firfox apply these styles to the pages
		if(Prototype.Browser.Gecko){
			
			$('adiqFormPanel').setStyle({top: '105px'});
			$('adiqFormPanel').setStyle({left: '35px'});
		
		//else if browser is Chrome or Safari apply these styles to the pages
		}else if(Prototype.Browser.WebKit){
			
			$('adiqFormPanel').setStyle({top: '100px'});
			$('adiqFormPanel').setStyle({left: '35px'});
		
		//else apply these styles for IE support
		}else{
			$('adiqFormPanel').style.cssText = 'top: 95px';
		}
	}
	
	//if the consumer is submitting a postal apply these changes
	if(formType == 'address'){
		
		//if browser is Firfox apply these styles to the pages
		if(Prototype.Browser.Gecko){
			
			$('adiqFormPanel').setStyle({top: '86px'});
			$('adiqFormPanel').setStyle({left: '35px'});
		
		//else if browser is Chrome or Safari apply these styles to the pages
		}else if(Prototype.Browser.WebKit){
			
			$('adiqFormPanel').setStyle({top: '90px'});
			$('adiqFormPanel').setStyle({left: '35px'});

		//else apply these styles for IE support
		}else{
			$('adiqFormPanel').style.cssText = 'top: 82px';
		}
	}
}
