
var dir;
dir = "http://www.aurora-israel.co.il/";

var Utf8 = {

	// public method for url encoding
	encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// public method for url decoding
	decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}

}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function changeInputs()
{
var els = document.getElementsByTagName('input');
var elsLen = els.length;
var i = 0;
for ( i=0;i<elsLen;i++ )
{
if ( els[i].getAttribute('type') )
{
if ( els[i].getAttribute('type') == "text" )
els[i].className = 'text';
else
els[i].className = 'cuInput';
}
}
}

function addfav()
   {
   if (document.all)
      {
      window.external.AddFavorite
      ("http://www.aurora-israel.co.il","Aurora Digital")
      }
   }
   
   function addfavtel()
   {
   if (document.all)
      {
      window.external.AddFavorite
      ("http://www.aurora-israel.co.il/articulos/israel/MundoJudio/20694/","Aurora Israel")
      }
   }


function top_index() {
	/*var h;
	h = document.getElementById('fnews').offsetHeight - 90;
	document.getElementById('main-two').style.marginTop = h+"px";
	//document.getElementById('main-three').style.marginTop = h+"px";
	if(BrowserDetect.browser == "Explorer") {
		if(BrowserDetect.version  == "6") {
			document.getElementById('main-three').style.marginTop = "-13px";
		}
		
	}
	
	document.getElementById('main-two').style.visibility = "visible";
	document.getElementById('main-one').style.visibility = "visible";
	document.getElementById('main-three').style.visibility = "visible";
	document.getElementById('main-four').style.visibility = "visible";*/
}

function start() {

	
	if(BrowserDetect.browser == "Explorer") {
		if(BrowserDetect.version  == "6") {
			document.getElementById('main-services-three').style.marginTop = "0px";
			document.getElementById('main-services-two').style.marginTop = "0px";
		}
	}
	
	
}

function fix_footer(){
var highest_height=0;
var colums=new Array(document.getElementById('main-one').offsetHeight,document.getElementById('main-two').offsetHeight,document.getElementById('main-three').offsetHeight,document.getElementById('main-four').offsetHeight);
for(var i=0;i<4;i++){
	if(colums[i]>highest_height){
			highest_height=colums[i];
		}
	}
var h;
h = document.getElementById('fnews').offsetHeight
var header=450+h;
var total;
total = highest_height + header;
var index="http://www.aurora-israel.co.il/index.php";
var index1="http://www.aurora-israel.co.il/";
if((document.location==index)||(document.location==index1)){
document.getElementById('footer').style.marginTop=total+"px";
}
else
{
document.getElementById('footer').style.marginTop=highest_height+"px";
}
}

function fix_footer_index(){
var highest_height=0;
var colums=new Array(document.getElementById('main-one').offsetHeight,document.getElementById('main-two').offsetHeight,document.getElementById('main-three').offsetHeight,document.getElementById('main-four').offsetHeight,document.getElementById('in-4-last').offsetHeight);
for(var i=0;i<5;i++){
	if(colums[i]>highest_height){
			highest_height=colums[i];
		}
	}
var h;
h = document.getElementById('fnews').offsetHeight - 100;
var header=350+h;
var total;
total = highest_height + header;
var index="http://www.aurora-israel.co.il/index.php";
var index1="http://www.aurora-israel.co.il/";
if((document.location==index)||(document.location==index1)){
document.getElementById('footer').style.marginTop=total+"px";
}
else
{
document.getElementById('footer').style.marginTop=highest_height+"px";
}
}


	var hour;
			var mins;
			var sec;
			function clock(){
				this.sec++;
				if(sec=="60"){
					this.mins++;
					this.sec=0;
				}
				if(mins=="60"){
					this.hour++;
					this.mins=0;
				}
				if(hour=="24"){
					this.hour=0;
					this.mins=0;
					this.sec=0;
				}
				var mins_add;
				var sec_add;
				var hour_add;
				if(mins<10) {
					mins_add = "0";
				}
				else {
					mins_add = "";
				}
				if(sec<10) {
					sec_add = "0";
				}
				else {
					sec_add = "";
				}
				if(hour<10) {
					hour_add = "0";
				}
				else {
					hour_add = "";
				}
				document.getElementById("clock").innerHTML=hour_add+hour+":"+mins_add+mins+":"+sec_add+sec;
			}
			function set_clock(hour,mins,sec){
				this.hour=hour;
				this.mins=mins;
				this.sec=sec;
			}
			
function newAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function loadSecondPart(){
	var contenedor;
	contenedor = document.getElementById('bottom');
	ajax=newAjax();
	ajax.open("POST", dir+"SECONDPARTLOAD.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText;
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send();
}

function loadFirstRowBans(ban_test){
	var contenedor;
	contenedor = document.getElementById('firstRowAjaxBanners');
	ajax=newAjax();
	ajax.open("POST", dir+"FirstRowBans.php?ban_test=" + ban_test,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText;
			loadFourthRowBans(ban_test);
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send();
}

function loadFourthRowBans(ban_test){
	var contenedor;
	contenedor = document.getElementById('fourthColBanners');
	ajax=newAjax();
	ajax.open("POST", dir+"FourthRowBans.php?ban_test=" + ban_test,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText;
			loadVids();
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send();
}

function loadVids(){
	var contenedor;
	contenedor = document.getElementById('Videos');
	ajax=newAjax();
	ajax.open("POST", dir+"youtubevids.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText;
			loadEditorial();
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send();
}

function loadEditorial(){
	var contenedor;
	contenedor = document.getElementById('grupoEditorial');
	ajax=newAjax();
	ajax.open("POST", dir+"editorial.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send();
}

function loadRests(ban_test)
{
		setTimeout("loadrestspage(" + ban_test + ")", 500);

}

function loadrestspage(ban_test)
{
	loadFirstRowBans(ban_test);
}

function call_comment(id, comnum){
	var contenedor;
	contenedor = document.getElementById('id_'+id);
	ajax=newAjax();
	ajax.open("POST", dir+"get_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("id="+id+"&num="+comnum+"&com=0")
}

function call_post_comment(id, comnum){
	var contenedor;
	contenedor = document.getElementById('id_'+id);
	ajax=newAjax();
	ajax.open("POST", "http://www.aurora-israel.co.il/get_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("id="+id+"&num="+comnum+"&com=1")
}

function close_comment(id, comnum){
	var contenedor;
	contenedor = document.getElementById('id_'+id);
	ajax=newAjax();
	ajax.open("POST", dir+"close_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("id="+id+"&num="+comnum+"&com=0")
}

function close_post_comment(id, comnum){
	var contenedor;
	contenedor = document.getElementById('id_'+id);
	ajax=newAjax();
	ajax.open("POST", "http://www.aurora-israel.co.il/close_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("id="+id+"&num="+comnum+"&com=1")
}

function addStatClick(id){
	//var contenedor;
	//contenedor = document.getElementById('bandebug');
	ajax=newAjax();
	ajax.open("POST", "http://www.aurora-israel.co.il/add_stat.php?id=" + id,true);
	/*ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}*/
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send()
}

function add_comment(id){

	var contenedor, name, email, visible, web, title, com, i, v;
	contenedor = document.getElementById('send_com');
	name = document.getElementById('name').value;
	if(name=="") {
		alert("Introduzca un nombre por favor");
		return 0;
	}
	email = document.getElementById('email').value;
	visible = document.com_snd.visible;
	for(i=0; i<visible.length; i++){
		if(visible[i].checked) {
			v = visible[i].value;
		}
	}
	web = document.getElementById('web').value;
    title = document.getElementById('title').value;
	if(title=="") {
		alert("Introduzca un titulo por favor");
		return 0;
	}

	com = document.getElementById('combody').value;
	ajax=newAjax();
	ajax.open("POST", dir+"add_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("name="+name+"&email="+email+"&visible="+visible+"&web="+web+"&title="+title+"&body="+com+"&pid="+id);
	
}

function add_post_comment(id){
	
	var contenedor, name, email, visible, web, title, com, i, v;
	contenedor = document.getElementById('send_com');
	name = document.getElementById('name').value;
	if(name=="") {
		alert("Introduzca un nombre por favor");
		return 0;
	}
	email = document.getElementById('email').value;
	visible = document.com_snd.visible;
	for(i=0; i<visible.length; i++){
		if(visible[i].checked) {
			v = visible[i].value;
		}
	}
	web = document.getElementById('web').value;
    title = document.getElementById('title').value;
	if(title=="") {
		alert("Introduzca un titulo por favor");
		return 0;
	}

	com = document.getElementById('combody').value;
	ajax=newAjax();
	ajax.open("POST", "http://www.aurora-israel.co.il/add_comment.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("name="+name+"&email="+email+"&visible="+visible+"&web="+web+"&title="+title+"&body="+com+"&bid="+id);
	
}


function cargarContacto() {
	var contenedor, name, empresa, tel, email, web, comments;
	contenedor = document.getElementById('main-services-one');
	name = document.getElementById('name').value;
	empresa = document.getElementById('empresa').value;
	tel = document.getElementById('tel').value;
	email = document.getElementById('email').value;
	web = document.getElementById('web').value;
	comment = document.getElementById('comments').value;
	ajax=newAjax();
	ajax.open("POST", dir+"pub_sent.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText;
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("name="+name+"&comment="+comment+"&empresa="+empresa+"&tel="+tel+"&email="+email+"&web="+web);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function loginToBlog() {
	var allRight;
	allRight = 1;
	if(document.loginBlogForm.user.value == "") {
		allRight = 0;
		alert("Introduzca un nombre de usuario por favor");
	}
	if((allRight == 1) && (document.loginBlogForm.pass.value == "")) {
		allRight = 0;
		alert("Introduzca una clave por favor");
	}
	if(allRight == 1) {
		document.loginBlogForm.submit();
	}
}

function submitNewBlog() {
	var allRight;
	allRight = 1;
	if(document.newBlogForm.fName.value == "") {
		allRight = 0;
		alert("Introduzca un nombre por favor");
	}
	if((allRight == 1) && (document.newBlogForm.country.value == "")) {
		allRight = 0;
		alert("Introduzca un pais por favor");
	}
	if((allRight == 1) && ((document.newBlogForm.eMail.value.indexOf("@") == -1) || (document.newBlogForm.eMail.value.indexOf(".") == -1))) {
		allRight = 0;
		alert("E-mail incorrecto");
	}
	if((allRight == 1) && (document.newBlogForm.user.value == "")) {
		allRight = 0;
		alert("Introduzca un nombre de usuario por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.user.value.indexOf(" ") != -1)) {
		allRight = 0;
		alert("Introduzca un nombre de usuario por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.user.value.indexOf(".") != -1)) {
		allRight = 0;
		alert("Introduzca un nombre de usuario por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.user.value.indexOf(",") != -1)) {
		allRight = 0;
		alert("Introduzca un nombre de usuario por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.pass.value == "")) {
		allRight = 0;
		alert("Introduzca un clave secreta de usuario por favor");
	}
	if((allRight == 1) && (document.newBlogForm.pass.value != document.newBlogForm.pass2.value)) {
		allRight = 0;
		alert("Las claves no coinciden");
	}
	if((allRight == 1) && (document.newBlogForm.blogName.value == "")) {
		allRight = 0;
		alert("Elija un nombre para su blog por favor");
	}
	if((allRight == 1) && (document.newBlogForm.blogdir.value == "")) {
		allRight = 0;
		alert("Elija una direccion para su blog por favor. la direccion no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.blogdir.value.indexOf(" ") != -1)) {
		allRight = 0;
		alert("Elija una direccion para su blog por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.blogdir.value.indexOf(".") != -1)) {
		allRight = 0;
		alert("Elija una direccion para su blog por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	if((allRight == 1) && (document.newBlogForm.blogdir.value.indexOf(",") != -1)) {
		allRight = 0;
		alert("Elija una direccion para su blog por favor. el nombre de usuario no puede tener espacios, puntos o comas");
	}
	
	
	if((allRight == 1) && (document.newBlogForm.aboutMe.value == "")) {
		allRight = 0;
		alert("Escriba unas palabras sobre usted por favor");
	}
	if((allRight == 1) && (document.newBlogForm.aboutBlog.value == "")) {
		allRight = 0;
		alert("Escriba unas descripcion al blog por favor");
	}
	if(allRight == 1) {
		document.newBlogForm.submit();
	}
}

function addNewBlogPost() {
	var allRight;
	allRight = 1;
	if(document.addPostForm.title.value == "") {
		allRight = 0;
		alert("Introduzca un titulo por favor");
	}
	if((allRight == 1) && (document.addPostForm.cat.value == 0)) {
		allRight = 0;
		alert("Elija una categoria por favor");
	}
	if(allRight == 1) {
		document.addPostForm.action.value = "add";
		document.addPostForm.submit();
	}
}

function updateBlogPost() {
	var allRight;
	allRight = 1;
	if(document.updatePostForm.title.value == "") {
		allRight = 0;
		alert("Introduzca un titulo por favor");
	}
	if((allRight == 1) && (document.updatePostForm.cat.value == 0)) {
		allRight = 0;
		alert("Elija una categoria por favor");
	}
	if(allRight == 1) {
		document.updatePostForm.action.value = "update";
		document.updatePostForm.submit();
	}
}

function deleteBlogPost() {
	
		document.updatePostForm.action.value = "del";
		document.updatePostForm.submit();
	
}

function getupdateblog(id){
var table = document.getElementById("art_table");   
var rows = table.getElementsByTagName("tr");   
for(i = 0; i < rows.length; i++){   
rows[i].style.backgroundColor = '#FFFFFF' 
}
var contenedor;
	contenedor = document.getElementById('form');
	ajax=newAjax();
	ajax.open("POST", "blogeditupdate.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("id="+id)
}

function goto(place) {
	window.location = place;
}


function revistaCheck() {
	
	if(document.getElementById("firstName").value == "")
	{
		alert("Introduzca su Nombre por favor");
		return 0;
	}
	if(document.getElementById("lastName").value == "")
	{
		alert("Introduzca su apellido por favor");
		return 0;
	}
	if(document.getElementById("city").value == "")
	{
		alert("Introduzca una ciudad por favor");
		return 0;
	}
	if(document.getElementById("country").value == "")
	{
		alert("Introduzca un pais por favor");
		return 0;
	}
	if(document.getElementById("address").value == "")
	{
		alert("Introduzca una direccion por favor");
		return 0;
	}
	if(document.getElementById("tel").value == "")
	{
		alert("Introduzca su numero de telefono por favor");
		return 0;
	}
	if(document.getElementById("email").value == "")
	{
		alert("Introduzca su E-mail por favor");
		return 0;
	}
	if(document.getElementById("user").value == "")
	{
		alert("Introduzca su nombre de usurio por favor");
		return 0;
	}
	if(document.getElementById("pass").value == "")
	{
		alert("Introduzca su password por favor");
		return 0;
	}
	if(document.getElementById("cs").value == "" || isNaN(document.getElementById("cs").value))
	{
		alert("Introduzca el codigo de seguridad de la tarjeta por favor");
		return 0;
	}
	if(document.getElementById("c1").value == "" || isNaN(document.getElementById("c1").value))
	{
		alert("Introduzca el numero de tarjeta de credito por favor");
		return 0;
	}
	if(document.getElementById("c2").value == "" || isNaN(document.getElementById("c2").value))
	{
		alert("Introduzca el numero de tarjeta de credito por favor");
		return 0;
	}
	if(document.getElementById("c3").value == "" || isNaN(document.getElementById("c3").value))
	{
		alert("Introduzca el numero de tarjeta de credito por favor");
		return 0;
	}
	if(document.getElementById("c4").value == "" || isNaN(document.getElementById("c4").value))
	{
		alert("Introduzca el numero de tarjeta de credito por favor");
		return 0;
	}
	if(document.getElementById("1sh").checked == false && document.getElementById("1usd").checked == false && document.getElementById("2sh").checked == false && document.getElementById("2usd").checked == false && document.getElementById("3sh").checked == false && document.getElementById("3usd").checked == false)
	{
		alert("Elija por cuanto tiempo durara la suscripcion");
		return 0;	
	}
	
	var paytype;
	if(document.getElementById("1sh").checked)
	{
		paytype = "350-nis";
	}
	if(document.getElementById("2sh").checked)
	{
		paytype = "200-nis";
	}
	if(document.getElementById("3sh").checked)
	{
		paytype = "120-nis";
	}
	if(document.getElementById("1usd").checked)
	{
		paytype = "90-usd";
	}
	if(document.getElementById("2usd").checked)
	{
		paytype = "50-usd";
	}
	if(document.getElementById("3usd").checked)
	{
		paytype = "30-usd";
	}
	try {
	if(document.getElementById("4usd").checked)
	{
		paytype = "80-usd";
	}
	if(document.getElementById("5usd").checked)
	{
		paytype = "60-usd";
	}
	if(document.getElementById("6usd").checked)
	{
		paytype = "35-usd";
	}
	}
	catch(ex) { };
	
	var contenedor;
	contenedor = document.getElementById('oConnectContent2');
	ajax=newAjax();
	ajax.open("POST", "semanariobuy.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("type=sem&payment=" + paytype + "&fname= " + document.getElementById("firstName").value + "&lname= " + document.getElementById("lastName").value  + "&country= " + document.getElementById("country").value + "&city= " + document.getElementById("city").value + "&address= " + document.getElementById("address").value + "&tel= " + document.getElementById("tel").value + "&email= " + document.getElementById("email").value + "&user= " + document.getElementById("user").value + "&pass= " + document.getElementById("pass").value + "&cs= " + document.getElementById("cs").value + "&c1= " + document.getElementById("c1").value + "&c2= " + document.getElementById("c2").value + "&c3= " + document.getElementById("c3").value + "&c4= " + document.getElementById("c4").value);

}

