var url = window.location;
//var language = (navigator.userLanguage)? navigator.userLanguage : navigator.language;
//var ip = '<!--#echo var="REMOTE_ADDR"-->';

function loadAd(id, Size, CompanyID, BorderColor, HeadlineColor, TextColor, URLColor, CarbonOffsetColor, adId)
{
	var iFrameWidth = 0;
	var iFrameHeight = 0;
	switch( Size )
	{
		case "1"	: iFrameWidth = 480; iFrameHeight = 60; break;
		case "2"	: iFrameWidth = 300; iFrameHeight = 250; break;
		case "3"	: iFrameWidth = 728; iFrameHeight = 90; break;
		case "4"	: iFrameWidth = 120; iFrameHeight = 600; break;
		case "5"	: iFrameWidth = 160; iFrameHeight = 600; break;
		case "6"	: iFrameWidth = 125; iFrameHeight = 245; break;
		case "7"	: iFrameWidth = 125; iFrameHeight = 125; break;		
		case "8"	: iFrameWidth = 180; iFrameHeight = 150; break;				
		case "10"	: iFrameWidth = 240; iFrameHeight = 400; break;						
		case "11"	: iFrameWidth = 250; iFrameHeight = 250; break;
		case "12"	: iFrameWidth = 300; iFrameHeight = 100; break;
		case "13"	: iFrameWidth = 300; iFrameHeight = 600; break;
		case "14"	: iFrameWidth = 336; iFrameHeight = 280; break;
	}

var parameters = "id="+id+"&CompanyID="+CompanyID+"&addr="+url+"&Size="+Size+"&BorderColor="+BorderColor+"&HeadlineColor="+HeadlineColor+"&TextColor="+TextColor+"&URLColor="+URLColor+"&CarbonOffsetColor="+CarbonOffsetColor+"&adId="+adId;
//var parameters = "id="+id+"&CompanyID="+CompanyID+"&addr="+url+"&Size="+Size+"&BorderColor="+BorderColor+"&HeadlineColor="+HeadlineColor+"&TextColor="+TextColor+"&URLColor="+URLColor+"&CarbonOffsetColor="+CarbonOffsetColor;
	document.write("<div style='width:"+iFrameWidth+"; height:"+iFrameHeight+"; background:#FFF;'>");
	document.write("<iframe frameborder='0' scrolling='no' style='border:solid 0px #fff;background:#FFF;' src='http://localhost:8500/planetup/planetUpLinks/loadAdd2.cfm?"+parameters+"' width='"+iFrameWidth+"' height='"+iFrameHeight+"' marginwidth='0' marginheight='0'></iframe>");
	document.write("</div");
//alert (parameters);

}

function ajaxLoader(url,id) {
  if (document.getElementById) {
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  }
  if (x) {
    x.onreadystatechange = function() {
      if (x.readyState == 4 && x.status == 200) {
        el = document.getElementById(id);
        el.innerHTML = x.responseText;
      }
    }
    x.open("GET", url+"?idioma="+lengua, true);
    x.send(null);
  }
}


