'+"\n"+
''+"\n"+
'';
$('generated-code').value=code;
//eval(code);
//$('gadget-google').value=code;
}
};
Config=function(option){
if(validateForm()){
if(option==true){
document.getElementById("Avanzadas").hidden=false;
}else{
document.getElementById("Avanzadas").hidden=true;
}
}else{
alert("Completa los campos del formulario para ver las opciones avanzadas");
}
};
DetectStyle=function(){
var option=text("skin");
if(!option){
document.getElementById("config").hidden=true;
}else{
document.getElementById("config").hidden=false;
}
};
DetectSelect=function(){
var option=text("imgSelect");
switch(option){
case "1":
document.getElementById("user_bgimg").hidden=true;
document.getElementById("gallery_bgimg").hidden=false;
document.getElementById("bgcolor").hidden=true;
break;
case "2":
document.getElementById("user_bgimg").hidden=false;
document.getElementById("gallery_bgimg").hidden=true;
document.getElementById("bgcolor").hidden=true;
break;
case "3":
document.getElementById("user_bgimg").hidden=true;
document.getElementById("gallery_bgimg").hidden=true;
document.getElementById("bgcolor").hidden=false;
break;
}
};
getcode=function(option){
if(validateForm()){
if(!option){
document.getElementById("codigo").hidden=true;
}else{
document.getElementById("codigo").hidden=false;
}
}
};
});
//Separa las direcciones URL en https:// | host | puerto
function breakURL(url){
matches = /([a-zA-Z]+):\/\/([\-\w\.]+)(?:\:(\d{0,5}))?/.exec(url);
foo = new Array();
if(matches){
for( i = 1; i < matches.length ; i++){ foo.push(matches[i]); }
}
return foo
}
function requireCSS(file) {
var cssLink = $("");
$("head").append(cssLink);
}
function removejscssfile(filename, filetype){
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
var allsuspects=document.getElementsByTagName(targetelement)
for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
}
}
function require(script,code) {
$.ajax({
url: script,
dataType: "script",
async: false,
success: function () {
eval(code);
},
error: function () {
throw new Error("Could not load script " + script);
}
});
}