﻿/*****
loftmodels
******/

var scroolpages = 0;
var whereami = 0;

function changemeta(meta,content){
 // First, get the array of meta-tag elements

    metatags = document.getElementsByTagName("meta");

    // Iterate through the array, listing them all

    // Update only the Title meta tag

    for (cnt = 0; cnt < metatags.length; cnt++){
        alert(cnt);
        if (metatags[cnt].getAttribute("name") == meta)
              metatags[cnt].setAttribute("content", content);
              return;
    }
}



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: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			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.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


function encodeme(string){
	if(BrowserDetect.browser == 'Explorer'){
		return string;
	}else{
		return encodeURI(string);
	}

}

function changefilter(id){
                        document.getElementById('sub3').className = 'linksize3';
                        //document.getElementById('sub3').style.color = '#333333';
                        document.getElementById('sub4').className = 'linksize3';
                        //document.getElementById('sub4').style.color = '#333333';
                        document.getElementById('sub5').className = 'linksize3';
                        //document.getElementById('sub5').style.color = '#333333';
	
		if(id==0) sub = 'sub3';
		if(id==1) sub = 'sub4';
		if(id==2) sub = 'sub5';

	
                        document.getElementById(sub).className = 'aceso3';
                        //document.getElementById(sub).style.color = '#0f0';
                        //document.getElementById(sub).onmouseout = function(){};

}

function changetype(id){
		if(id == 0) return;
		if(id==2){
                        document.getElementById('sub1').className = 'linksize2';
                        //document.getElementById('sub1').style.color = '#333333';
                        document.getElementById('sub2').className = 'aceso2';
                        //document.getElementById('sub2').style.color = '#0f0';
                        //document.getElementById('sub2').onmouseout = function(){};
                }else{
                        document.getElementById('sub2').className = 'linksize2';
                        //document.getElementById('sub2').style.color = '#333333';
                        document.getElementById('sub1').className = 'aceso2';
                        //document.getElementById('sub1').style.color = '#0f0';
                        //document.getElementById('sub1').onmouseout = function(){};
        }


}


function changelist(){
	 if(readCookie('lista')==1){
                        document.getElementById('sub6').className = 'linksize3';
                        //document.getElementById('sub6').style.color = '#333333';
                        document.getElementById('sub7').className = 'aceso3';
                        //document.getElementById('sub7').style.color = '#0f0';
                		//document.getElementById('sub7').onmouseout = function(){};;
                }else{
                        document.getElementById('sub7').className = 'linksize3';
                        //document.getElementById('sub7').style.color = '#333333';
                        document.getElementById('sub6').className = 'aceso3';
                        //document.getElementById('sub6').style.color = '#0f0';
                		//document.getElementById('sub6').onmouseout = function(){};
                }  
}


function startlang(){
    if(!readCookie('language')){
        createCookie('language','pt');
    }
}   

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}


//init;


 var slideTimer;
	var transitionTime;
	var items;
	var itemNum = 0;
    var where;
    var galleryarray = new Array();
    var view = 0;

    	var b=new Array();
	b['Modelos']='linktopo1';
	b['People']='linktopo2';
	b['Actors']='linktopo3';
	b['Stars']='linktopo4';
	b['Talents']='linktopo5';
	b['agencia']='linkbottom1';
	b['inscricoes']='linkbottom2';
	b['parceiros']='linkbottom4';
	b['contactos']='linkbottom5';





function togSub(elem){
	var flag = 0;
	var menus1 = getElementsByClass('linksize1');	
	for (i=0; i<menus1.length; i++){
		if(elem.id == menus1[i].id) flag = 1; 
		document.getElementById(menus1[i].id).className = 'linksize1';
		//document.getElementById(menus1[i].id).style.color = '#3d3d3d';
	}
	var menus1 = getElementsByClass('aceso1');	
	for (i=0; i<menus1.length; i++){
		document.getElementById(menus1[i].id).className = 'linksize1';
		//document.getElementById(menus1[i].id).style.color = '#3d3d3d';
	}
	var menus2 = getElementsByClass('linksize4');
    for (i=0; i<menus2.length; i++){
     	if(elem.id == menus2[i].id) flag = 2; 
	       document.getElementById(menus2[i].id).className = 'linksize4';
           //document.getElementById(menus2[i].id).style.color = '#3d3d3d';
	 }
        var menus2 = getElementsByClass('acesobottom1');
        for (i=0; i<menus2.length; i++){
                document.getElementById(menus2[i].id).className = 'linksize4';
                //document.getElementById(menus2[i].id).style.color = '#3d3d3d';
        }
if(flag == 1){	
  document.getElementById(elem.id).className = 'aceso1';  
}
if(flag == 2){	
  document.getElementById(elem.id).className = 'acesobottom1';  
}
  //document.getElementById(elem.id).style.color = '#0f0';
  document.getElementById(elem.id).onmouseout = function(){};;
}

function startme(){
    aux = SWFAddress.getValue().split('/');
    if(aux[1] != ""){ 
    	elem = document.getElementById(b[aux[1]]);
        togSub(elem);
    }
}

function flashme(){
    if(typeof sIFR == "function"){
        sIFR.replaceElement(named({sSelector:"h1.nome",sWmode:"opaque", sFlashSrc:"/georgia.swf", sColor:"#000000", sLinkColor:"#00000", sBgColor:"#ffffff", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=center&offsetTop=0"}));
    }
}

function flashtitle(){
    if(typeof sIFR == "function"){
        sIFR.replaceElement(named({sSelector:"div.titulo",sWmode:"opaque", sFlashSrc:"/georgia.swf", sColor:"#000000", sLinkColor:"#00000", sBgColor:"#ffffff", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
    }
}

function flashinscricoes(){
    if(typeof sIFR == "function"){
        sIFR.replaceElement(named({sSelector:"div.titulodados",sWmode:"opaque", sFlashSrc:"/georgia.swf", sColor:"#000000", sLinkColor:"#00000", sBgColor:"#ffffff", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
        sIFR.replaceElement(named({sSelector:"div.tituloshort",sWmode:"opaque", sFlashSrc:"/georgia.swf", sColor:"#000000", sLinkColor:"#00000", sBgColor:"#ffffff", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
    }
}

/******
onde estou
******/
   
   function start(){
    aux = SWFAddress.getValue().split('/');
	if(aux[1] == ''){
            acendetopo(-1);
	 
	} 
    if(aux[1] == 'Modelos'){
	    acendetopo(1);
		if(aux[2] == ''){
        		acendesubmenu(3);
		}
            subtransform(3); 
	 }
         if(aux[1] == 'People'){
            acendetopo(2);
       	    return; 
	}
         if(aux[1] == 'Actors'){
            acendetopo(3);
       	    return; 
        }
         if(aux[1] == 'Stars'){
            acendetopo(4);
       	    return; 
        }
         if(aux[1] == 'Talents'){
            acendetopo(5);
       	    return; 
        }
        if(aux[1] == 'agencia'){
            acendetopo(-2);
            acendebottom(1);
       	    return; 
        }
         if(aux[1] == 'inscricoes'){
            acendetopo(-2);
            acendebottom(2);
       	    return; 
        }
        if(aux[1] == 'newsletter'){
            acendetopo(-2);
            acendebottom(3);
       	    return; 
        }
        if(aux[1] == 'parceiros'){
            acendetopo(-2);
            acendebottom(4);
       	    return; 
        }
        if(aux[1] == 'contactos'){
            acendetopo(-2);
            acendebottom(5);
       	    return; 
        }
		
	
	if(aux[2] == 'Nacionais'){
            acendesubmenu(1);
            subtransform(1); 
	 }
	if(aux[2] == 'Internacionais'){
            acendesubmenu(2);
            subtransform(2); 
	}
	if(aux[3] == 'Femininos'){
            acendesubmenu(4);
            subtransform(4); 
	}
	if(aux[3] == 'Masculinos'){
            acendesubmenu(5);
            subtransform(5); 
	}
	

}
    


function clean() {

	 var index = 0;
     var elemento;
      
		for(index=0;index<items.length;index++){
    		if(index == 0){
	    		items[index].removeClass('primeira');
		    	items[index].setStyle('left', "0");
	    	}else{
			    items[index].setStyle('left', "800px");
		    }
		}
	};



function targetBlank (url) {
  blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}
  
function targetpopup (url) {
  blankWin = window.open(url,'_blank','width=415px,height=962px,menubar=no,toolbar=no,location=no,directories=no,fullscreen=no,titlebar=no,hotkeys=no,status=no,scrollbars=no,resizable=no');
}





function subtransform(id){
    if(id==1){   
        document.getElementById('sub3').title = "/Modelos/Nacionais/";
        document.getElementById('sub4').title = "/Modelos/Nacionais/Femininos/";
        document.getElementById('sub5').title = "/Modelos/Nacionais/Masculinos/";
    }else if(id==2){
        document.getElementById('sub3').title = "/Modelos/Internacionais/";
        document.getElementById('sub4').title = "/Modelos/Internacionais/Femininos/";
        document.getElementById('sub5').title = "/Modelos/Internacionais/Masculinos/";
    }else if(id==3){
        document.getElementById('sub1').title = "/Modelos/Nacionais/";
        document.getElementById('sub2').title = "/Modelos/Internacionais/";
    }else if(id==4){
        document.getElementById('sub1').title = "/Modelos/Nacionais/Femininos/";
        document.getElementById('sub2').title = "/Modelos/Internacionais/Femininos/";
    }else if(id==5){
        document.getElementById('sub1').title = "/Modelos/Nacionais/Masculinos/";
        document.getElementById('sub2').title = "/Modelos/Internacionais/Masculinos/";
    }else{
        document.getElementById('sub3').title = "/Modelos/";
        document.getElementById('sub4').title = "/Modelos/Femininos/";
        document.getElementById('sub5').title = "/Modelos/Masculinos/";
    }
}


//firefox e outros HACK
function resetmo(el){
/*	document.getElementById('linktopo1').onmouseout = function() { document.getElementById("linktopo1").style.color="#3d3d3d" };
	document.getElementById('linktopo2').onmouseout = function() { document.getElementById("linktopo2").style.color="#3d3d3d" };
	document.getElementById('linktopo3').onmouseout = function() { document.getElementById("linktopo3").style.color="#3d3d3d" };
	document.getElementById('linktopo4').onmouseout = function() { document.getElementById("linktopo4").style.color="#3d3d3d" };
	document.getElementById('linktopo5').onmouseout = function() { document.getElementById("linktopo5").style.color="#3d3d3d" };
	el.onmouseout = function(){};*/
}


function resetmo2(el){
	//document.getElementById('sub1').onmouseout = function() { document.getElementById("sub1").style.color="#3d3d3d" };
    //document.getElementById('sub2').onmouseout = function() { document.getElementById("sub2").style.color="#3d3d3d" };
	//el.onmouseout = function(){};
}


function resetmo3(el){
	//document.getElementById('sub3').onmouseout = function() { document.getElementById("sub3").style.color="#3d3d3d" };
    //document.getElementById('sub4').onmouseout = function() { document.getElementById("sub4").style.color="#3d3d3d" };
    //document.getElementById('sub5').onmouseout = function() { document.getElementById("sub5").style.color="#3d3d3d" };
	//el.onmouseout = function(){};
}


function resetmo4(el){
	//document.getElementById('sub6').onmouseout = function() { document.getElementById("sub6").style.color="#3d3d3d" };
    //document.getElementById('sub7').onmouseout = function() { document.getElementById("sub7").style.color="#3d3d3d" };
	//el.onmouseout = function(){};
}



function acendesubmenu(id){
	if(id == 0){
		document.getElementById('sub1').className = 'linksize2';
		document.getElementById('sub2').className = 'linksize2';
		document.getElementById('sub3').className = 'linksize3';
		document.getElementById('sub4').className = 'linksize3';
		document.getElementById('sub5').className = 'linksize3';
		//document.getElementById('sub2').style.color = '#333333';
		//document.getElementById('sub1').style.color = '#333333';
		//document.getElementById('sub3').style.color = '#333333';
		//document.getElementById('sub4').style.color = '#333333';
		//document.getElementById('sub5').style.color = '#333333';
  		document.getElementById('sub7').className = 'aceso3';
  		//document.getElementById('sub7').style.color = '#0f0';
  		//document.getElementById('sub7').onmouseout = function(){};;
		return;
	}

	if(id == 1 || id == 2){
		if(id==1){
			document.getElementById('sub2').className = 'linksize2';
			//document.getElementById('sub2').style.color = '#333333';
			document.getElementById('sub1').className = 'aceso2';
			//document.getElementById('sub1').style.color = '#0f0';
  			//document.getElementById('sub1').onmouseout = function(){};;
		}else{
			document.getElementById('sub1').className = 'linksize2';
			//document.getElementById('sub1').style.color = '#333333';
			document.getElementById('sub2').className = 'aceso2';
			//document.getElementById('sub2').style.color = '#0f0';
  			//document.getElementById('sub2').onmouseout = function(){};;
		}	
			return;
	}	
	if(id == 6 || id == 7){
                if(id==7){
			document.getElementById('sub6').className = 'linksize3';
			//document.getElementById('sub6').style.color = '#333333';
			document.getElementById('sub7').className = 'aceso3';
			d//ocument.getElementById('sub7').style.color = '#0f0';
  		//document.getElementById('sub7').onmouseout = function(){};;
                }else{
			document.getElementById('sub7').className = 'linksize3';
			//document.getElementById('sub7').style.color = '#333333';
			document.getElementById('sub6').className = 'aceso3';
			//document.getElementById('sub6').style.color = '#0f0';
  		//document.getElementById('sub6').onmouseout = function(){};;
                }	
	}
	if(id == 3 || id == 4 || id == 5){
                if(id==3){
			document.getElementById('sub4').className = 'linksize3';
			//document.getElementById('sub4').style.color = '#333333';
			document.getElementById('sub5').className = 'linksize3';
			//document.getElementById('sub5').style.color = '#333333';
			document.getElementById('sub3').className = 'aceso3';
			//document.getElementById('sub3').style.color = '#0f0';
  			//document.getElementById('sub3').onmouseout = function(){};;
                }else if(id==4){
			document.getElementById('sub3').className = 'linksize3';
			//document.getElementById('sub3').style.color = '#333333';
			document.getElementById('sub5').className = 'linksize3';
			//document.getElementById('sub5').style.color = '#333333';
			document.getElementById('sub4').className = 'aceso3';
			//document.getElementById('sub4').style.color = '#0f0';
  			//document.getElementById('sub4').onmouseout = function(){};;
                }else{
			document.getElementById('sub3').className = 'linksize3';
			//document.getElementById('sub3').style.color = '#333333';
			document.getElementById('sub4').className = 'linksize3';
			//document.getElementById('sub4').style.color = '#333333';
			document.getElementById('sub5').className = 'aceso3';
			//document.getElementById('sub5').style.color = '#0f0';
  			//document.getElementById('sub5').onmouseout = function(){};;
		}	
	}
}
            

function acendetopo(id){
    
if(id == -1){
  document.getElementById('menu2').style.display = 'none';
  document.getElementById('menu3').style.display = 'none';
  return;
}
  var buttons = document.getElementById('menu1').getElementsByTagName('span').length;
  for(i=1;i!=buttons+1;i++){
	document.getElementById('linktopo'+i).className = 'linksize1';
	//document.getElementById('linktopo'+i).style.color = '#333333';
 } 
 if(id == -2){
        return;
    }else{
        acendebottom(0);    
    }
  document.getElementById('linktopo'+id).className = 'aceso1';  
  //document.getElementById('linktopo'+id).style.color = '#0f0';
  //document.getElementById('linktopo'+id).onmouseout = function(){};;
if(id == 1){
  document.getElementById('menu2').style.display = 'block';
  document.getElementById('menu3').style.display = 'block';
  acendesubmenu(0);
  acendesubmenu(3); 
 }else{
 // document.getElementById('menu2').style.display = 'none';
 // document.getElementById('menu3').style.display = 'none';
 }
}
            
     
function acendebottom(id){
    acendetopo(-2);
    document.getElementById('menu2').style.display = 'none';
    document.getElementById('menu3').style.display = 'none';
    var buttons = 5 //5
    for(i=1;i!=buttons+1;i++){
	    document.getElementById('linkbottom'+i).className = 'linksize4';
	    //document.getElementById('linkbottom'+i).style.color = '#333333';
    }
    if(id == 0) return;
    document.getElementById('linkbottom'+id).className = 'acesobottom1';  
    //document.getElementById('linkbottom'+id).style.color = '#0f0';
    //document.getElementById('linkbottom'+id).onmouseout = function(){};

}
     
     
     
     
            function slideForward(){ 
	    var numItems = items.length;  //get number of slider items
	
		//get item to slide out
		var curItem = items[itemNum];  
		
		//change index
		if(itemNum < (numItems - 1)){
			itemNum++; 
		}
		else{
			itemNum = 0;
		}
		
		//now get item to slide in using new index
		var newItem = items[itemNum];
		
		
		//set up our animation stylings for out and in motions (note:  Fx.Styles does NOT exist in moo 1.2, so we must use Fx.Morph or Fx.Tween)
		var item_in = new Fx.Morph(newItem, {
			     duration: transitionTime, 
			     transition: Fx.Transitions.Quad.easeInOut, 
			     wait:false
		});
		
		var item_out = new Fx.Morph(curItem, {
			     duration: transitionTime, 
			     transition: Fx.Transitions.Quad.easeInOut, 
			     wait:false
		});
		
		//we will set a beginning value here
		//this is so that it gives the illusion of continuous motion from one direction, even after the first cycle of items
		item_in.start({
		'left': [800, 0]
		});
		
		//no beginning values needed, since we always want to push the old item out to the left
		item_out.start({
		'left': '-800'
		});
	};
	

	function sleep(delay){
	    var start = new Date().getTime();
	    while (new Date().getTime() < start + delay);
	}
	
	
		function  slideBackward(){ 
	
		//get item to slide out
		var curItem = items[itemNum];  
		
		//change index for reverse movement
		if(itemNum > 0){
			itemNum--; 
		}
		else{
			itemNum = (numItems - 1);
		}
		
		//now get item to slide in using new index
		var newItem = items[itemNum];
		
		
		var item_in = new Fx.Morph(newItem, {
			     duration: transitionTime, 
			     transition: Fx.Transitions.Quad.easeInOut, 
			     wait:false
		});
		
		var item_out = new Fx.Morph(curItem, {
			     duration: transitionTime, 
			     transition: Fx.Transitions.Quad.easeInOut, 
			     wait:false
		});
		
		
		//we will set a beginning value here too, but this time to make it come from left to right
		item_in.start({
		'left': [-800, 0]
		});
		
		//no beginning values needed
		item_out.start({
		'left': '800'
		});
		
	};
	//end slideBackward
	
	
	


    function next(el){
	    slideForward();
	    whereami++;
	    if(whereami == scroolpages-1) document.getElementById('r').style.display='none';
        if(whereami != 0) document.getElementById('l').style.display='inline';
   };
    
    function prev(el){
          slideBackward();
          whereami--;
	      if(whereami == 0) document.getElementById('l').style.display='none';
	      if(whereami != scroolpages-1) document.getElementById('r').style.display='inline';
   };
    
    
      
  
    var xmlHttp;
    
    function GetXmlHttpObject(){
        var xmlHttp=null;
        try
        {
            // Firefox, Opera 8.0+, Safari
            xmlHttp=new XMLHttpRequest();
        }
        catch (e)
        {
            //Internet Explorer
            try
            {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e)
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    
        function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

  function subscrever(){
        xmlHttp=GetXmlHttpObject();
        if (xmlHttp==null) {
            alert ("Browser does not support HTTP Request")
            return
        }
        var params = "&email=" + document.getElementById('email').value +  "&sid="+Math.random();
		
        var url="/html/subscreve.php";
        xmlHttp.onreadystatechange=subscreve;
        xmlHttp.open("POST",url,true)
        
        //Send the proper header information along with the request
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", params.length);
        xmlHttp.setRequestHeader("Connection", "close");
        xmlHttp.send(params);
    }
    
    function subscreve()
    {
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
        {
                   alert(xmlHttp.responseText);
        }
    }

 
              function inscreve(){
        xmlHttp=GetXmlHttpObject();
        if (xmlHttp==null) {
            alert ("Browser does not support HTTP Request")
            return
            }


         var params = "nome="+ document.getElementById('nome').value + 
    
        "&dian=" + document.getElementById('dia').value + 
        "&mesn=" + document.getElementById('mes').value + 
        "&anon=" + document.getElementById('ano').value + 
    
        "&idade=" + document.getElementById('idade').value + 
        "&sexo=" + getCheckedValue(document.forms['inscricao'].elements['sexo']) + 
        "&nacionalidade=" + document.getElementById('nacionalidade').value + 
        "&morada=" + document.getElementById('morada').value + 
        "&codpostal=" + document.getElementById('codpostal').value + 
        "&codpostal2=" + document.getElementById('codpostal2').value + 
        "&cidade=" + document.getElementById('cidade').value + 
    
        "&telefone=" + document.getElementById('telefone').value + 
        "&telemovel=" + document.getElementById('telemovel').value + 
        "&email=" + document.getElementById('email').value + 
        "&hab=" + document.getElementById('hab').value + 
        "&breves=" + document.getElementById('breves').value + 
        "&altura=" + document.getElementById('altura').value + 
        "&peito=" + document.getElementById('peito').value + 
  
        "&cintura=" + document.getElementById('cintura').value + 
        "&anca=" + document.getElementById('anca').value + 
      
        "&sapatos=" + document.getElementById('sapatos').value + 
        "&peso=" + document.getElementById('peso').value + 
      
        "&olhos=" + document.getElementById('olhos').value + 
        "&cabelo=" + document.getElementById('cabelo').value + 
    
        "&tatuagens=" + getCheckedValue(document.forms['inscricao'].elements['tatu'])  + 

        "&d="+Math.random();
       
        var url="/html/gravainscricao.php";
        xmlHttp.onreadystatechange=grava
        xmlHttp.open("POST",url,true)
        
        //Send the proper header information along with the request
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", params.length);
        xmlHttp.setRequestHeader("Connection", "close");
        xmlHttp.send(params);
    }
    
            function grava()
    {
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
        {
                   alert(xmlHttp.responseText);
        }
    }



