function remove_style(style_id,style_title) {
	  
	  
	if(confirm('Are you sure, you want to remove style '+style_title+'?')){
	  
	  
	  var xmlhttp = getXmlHttp()
			xmlhttp.open('GET', '/xml_my_embed_style_delete?style_id='+style_id, true);
			xmlhttp.onreadystatechange = function() {
			  if (xmlhttp.readyState == 4) {
			     if(xmlhttp.status == 200) {

					show_message(xmlhttp.responseText);
  					
		         }
			  }
			};
			xmlhttp.send(null);
			setTimeout("location=parent.location;",3000);
		
	
  			
			
	}

}

function create_style() {
	 
	
		var style_title = prompt ("Enter style title","New Style") ;
	if (style_title) {
	  var xmlhttp = getXmlHttp()
			
			var style_title = encodeURI(style_title);
			xmlhttp.open('GET', '/xml_my_embed_style_add?style_title='+style_title, true);
			xmlhttp.onreadystatechange = function() {
			  if (xmlhttp.readyState == 4) {
			     if(xmlhttp.status == 200) {

					show_message(xmlhttp.responseText);
  					
		         }
			  }
			};
			xmlhttp.send(null);
			setTimeout("location=parent.location;",3000);
		}
}



function style_logo(style_id) {
cur = new Date().getTime();
var upload = new AjaxUpload('logofile', {action: '/xml_my_embed_style_logo',name: 'logofile',data: {'style_id': style_id}, autoSubmit: true,
onSubmit: function() {document.getElementById('logofile_dummy').innerHTML = "Uploading...";},
onComplete: function() {document.getElementById('logofile_dummy').innerHTML = "Logo has been updated"; 
styleurl = '/img/logos/style'+style_id+'.png?'+cur;
document.getElementById('stylelogo').src = styleurl; 
show_message("Logo has been updated");
}
});

}



function set_default_style(style_id) {
			show_message("Please wait...");
  			var xmlhttp = getXmlHttp()
			xmlhttp.open('GET', '/xml_embed_style_set_default?id='+style_id, true);
			xmlhttp.onreadystatechange = function() {
			  if (xmlhttp.readyState == 4) {
			     if(xmlhttp.status == 200) {

					show_message(xmlhttp.responseText);
  					
		         }
			  }
			};
			xmlhttp.send(null);
			
			
}

