// JavaScript Document
function addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
    window.onload = function()
        {
        if (oldonload) {
        oldonload();
    }
        func();
   }
  }
}

function switchTabs(tabid,tabclass,contclass,trigger)
{
	$("."+tabclass).removeClass("selected");
	$("."+contclass).hide();
	$("#"+tabid).show();
	trigger.className = "sectabs selected";
	trigger.blur();
}
function roundCorners()
{
	$("div.rounded").corner("30px");	
}
addLoadEvent(function() {
roundCorners();

});


function getQsCode(frm)
{
	w = document.getElementById("width").value;
	radioobj = frm.wcolor;
	for(i = 0; i < radioobj.length; i++)
	{
		if(radioobj[i].checked == true)
		{
			clr = radioobj[i].value;
		}
	}
	aff_id = document.getElementById("affid").value;
	
	wt = new Array();
	wt["small"] = 200;
	wt["medium"] = 300;
	ht = new Array();
	ht["small"] = 100;
	ht["medium"] = 200;
	
	cnt = "<!--<bd_quickscan>-->\n<script src = \"media/scripts/getWidget.js\"></script><script>getWidget(\""+w+"\",\""+clr+"\",\""+aff_id+"\");</script>\n<!--</bd_quickscan>-->";
	//alert(cnt);
	content = "<iframe scrolling = \"no\" marginheight = \"0\" marginwidth = \"0\" frameborder = \"0\" width = \""+wt[w]+"\" height = \""+ht[w]+"\" src = \"widget.html?w="+w+"&color="+clr+"&affid="+aff_id+"\"></iframe>";
	document.getElementById("preview").innerHTML = content + "<br/><textarea>"+cnt+"</textarea>";
	
	return false;
}
