$(document).ready(function() {
	// start up functions

/*
	$("#AffiliateNickname").change(function() {
		$.getJSON(webpath +'pages/nickname_available/'+$("#AffiliateNickname").val() , function(j) {
			if(j == false){
				//alert("ID já existe, favor escolher outro.")
				$("#AffiliateNickname").focus();
			}
		});
	})
*/
//	// Lockups dos banners produtos
//	$(function(){
//
//		$('#windowBanners').dialog({
//			autoOpen: false,
//			width: 600,
//			height: 400,
//			buttons: {
//				"Ok": function() {
//					$(this).dialog("close");
//				},
//				"Cancel": function() {
//					$(this).dialog("close");
//				}
//			}
//		});
//	});
});

// Função para montar o conteúdo das lokups dos banners
function js_montalockup(sUrlSrc,sUrlHref,sAlt,lMontar){

  if (lMontar) {

    var sTagHtml  = "";
	      sTagHtml += "<textarea class=\"textarea-window-banners\" rows=\"6\" readonly=\"readonly\">";
        sTagHtml += "<!Início do código> \n\n";
        sTagHtml += "<a href=\""+sUrlHref+"\" target=\"_blank\">";
        sTagHtml += "<img src=\""+sUrlSrc+"\" alt=\""+sAlt+"\" border=\"0\" />";
        sTagHtml += "</a> \n\n";
        sTagHtml += "<!Fim do código>";
        sTagHtml += "</textarea>";

	  $('#windowBanners').dialog('open');
	  $("#windowContainer").html(sTagHtml);
  }

	return false;
}

function showBanners(Id) {

	var selectedEffect = $('#effectTypes').val();

	//most effect types need no options passed by default
	var options = {};
	//check if it's scale or size - they need options explicitly set
	if(selectedEffect == 'scale'){  options = {percent: 10}; }
	else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; }

	//run the effect
	$("#effect"+Id).toggle(selectedEffect,options,500);
	return false;
}
