var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-12428378-1");
pageTracker._trackPageview();
} catch(err) {}
if (window==top) {window.open ("/index.asp","_self")}

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function viewPort() {
	var h = top.window.innerHeight || top.document.documentElement.clientHeight || top.document.body.clientHeight ; 
 //|| top.document.getElementsByTagName('body')[0].clientHeight
	var w = top.window.innerWidth || top.document.documentElement.clientWidth || top.document.body.clientWidth;
//|| top.document.getElementsByTagName('body')[0].clientWidth
	return { width : w , height : h }
}

window.onload = function(){	
//alert( viewPort().width+"\n"+parent.parent.mainxs.document.getElementsByTagName('table')[0].offsetWidth+"\n"+parent.parent.mainxs.document.getElementsByTagName('body')[0].offsetWidth);
//top.location.pathname == "/" && 
	changeChatSliderSize();
}

function changeChatSliderSize(){
	if((window.self.name=="mainxs" || parent.window.self.name=="mainxs" ) && (window.self.location.pathname != "/home3.asp" || window.self.location.pathname != "/homeLastLogins.asp")){
		//setTimeout(informUser, 2400000);
		//setTimeout(checkSession, 2500000); //2700000 = 45Minuten
		var screenWidth = viewPort().width;
		screenWidth = screenWidth - 150; // calculate middle window size
		//parent.parent.mainxs.document.getElementsByTagName('body')[0].offsetWidth
		//parent.parent.mainxs.document.getElementsByTagName('body')[0].clientWidth
		//parent.parent.mainxs.document.getElementsByTagName('table')[0].offsetWidth
		//parent.parent.mainxs.document.getElementsByTagName('table')[0].clientWidth
		if(window.self.name=="mainxs"){
			var o_width = parent.parent.mainxs.document.getElementsByTagName('table')[0].offsetWidth;
			var w_width = parent.parent.mainxs.document.getElementsByTagName('body')[0].offsetWidth;
		}else{
			var o_width = window.document.getElementsByTagName('table')[0].offsetWidth;
			var w_width = window.document.getElementsByTagName('body')[0].offsetWidth;
		}
		
		if(o_width > w_width){
			var newWidth = screenWidth-o_width-30;//(o_width-w_width)+o_width;
			//$('#framesetxsmain').attr('cols','150,*,'+newWidth+',230');
			if(top.location.pathname == "/indextest.asp"){
				top.document.getElementById('framesetxsmain').setAttribute("cols","150,*,"+newWidth);
			}else{
				top.document.getElementById('framesetxsmain').setAttribute("cols","150,*,"+newWidth);
			}
						
		}
		if(o_width < w_width){
			var newWidth = screenWidth-o_width-30;//(o_width-w_width)+o_width;
			if(top.location.pathname == "/indextest.asp"){
				top.sliderEndWidth = newWidth;
				if(top.enteringWebsite!=0){					
					top.document.getElementById('framesetxsmain').setAttribute("cols","150,*,"+newWidth);
				}
			}else{
				top.sliderEndWidth = newWidth;
				if(top.enteringWebsite!=0){					
					top.document.getElementById('framesetxsmain').setAttribute("cols","150,*,"+newWidth);
				}
			}
			
		}
	}
 }

function informUser(){
	window.alert("Your Session will be closed in 5 minutes due inactivity!");
}

function informUser(){
	window.alert("Your Session will be closed in 5 minutes due inactivity!");
}
function checkSession(){ 
	if(window.self.name=="mainxs"){
		//parent.parent.mainxs.location = "/home.asp"; 
		//parent.parent.commxs.location = "/xscomm/xscomm.asp"; 
		parent.parent.commxs.jsLoginFunction();
	}else{
		parent.parent.commxs.jsLoginFunction();
		//top.mainxs.location = "/home.asp"; 
		//top.commxs.location = "/xscomm/xscomm.asp"; 
	}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function opencgv () {
window.open('/conditions.html','cgv','width=650,height=400,toolbar=no,scrollbars=yes,resizable=yes');
}
//
function clicie() {
	// Fonction de détection pour Internet Explorer
	if ((event.button==2)||(event.button==3)) {
		alert("©2007\r xsagency.com\r ALL RIGHT RESERVED");
	}
}
function clicns(e){
	// Fonction pour Netscape
	if(e.which==3){
alert("©2007\r xsagency.com\r ALL RIGHT RESERVED");
return false;
}
}


if (document.all) {	document.onmousedown=clicie;}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}
if (window.sidebar) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}


function addToFavorites(title,url){
 if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//



//
function checkCheckBox(){

Erreur = true;
	sname 		= document.inscrire.name.value;
	sPRENOM 	= document.inscrire.PRENOM.value;
	sADRESSE 	= document.inscrire.ADRESSE.value;
	sville		= document.inscrire.ville.value;
	sCODEPOSTAL = document.inscrire.CODEPOSTAL.value;
	scountry 	= document.inscrire.country.value;
	sTel	 	= document.inscrire.Tel.value;
	semail	 	= document.inscrire.Email0.value;
	sattach0 	= document.inscrire.photo_big.value;
	sattach1 	= document.inscrire.photo.value;
	texte="";
	
    if ((sname == "") || (! sname)) {	texte= texte+"enter your name.\n";    Erreur = false;}
    if ((sPRENOM == "") || (! sPRENOM)) {	texte= texte+"enter your lastname.\n";    Erreur = false;}
    if ((sADRESSE == "") || (! sADRESSE)) {	texte= texte+"enter your address.\n";    Erreur = false;}
    if ((sville == "") || (! sville)) {	texte= texte+"enter your city.\n";    Erreur = false;}
    if ((sCODEPOSTAL == "") || (! sCODEPOSTAL)) {	texte= texte+"enter your zip code.\n";    Erreur = false;}
    if (scountry == ":-:")  {	texte= texte+"Choose your country.\n";    Erreur = false;}
    if ((sTel == "") || (! sTel)) {	texte= texte+"enter your phone number\n";    Erreur = false;}
    if ((semail == "") || (! semail)) {	texte= texte+"enter your e-mail\n";    Erreur = false;}
    if ((sattach0 == "") || (! sattach0)) {	texte= texte+"indicate 'Main Photo' location\n";    Erreur = false;}
    if ((sattach1 == "") || (! sattach1)) {	texte= texte+"indicate 'vignette Photo' location\n";    Erreur = false;}

	texte= texte+" Thank you.";
	if (Erreur) {}
	else
	{alert(texte);}
return Erreur
}


////


//
function checkCheckBox3(){

Erreur = true;
	suser 		= document.modpass.username.value;
	spass1		= document.modpass.password.value;
	spass2	 	= document.modpass.password2.value;
	texte="";
	
    if ((suser == "") || (! suser)) {	texte= texte+"Enter a new username.\n";    Erreur = false;}
    if ((spass1 == "") || (! spass1)) {	texte= texte+"Enter a password.\n";    Erreur = false;}
    if ((spass2 == "") || (! spass2)) {	texte= texte+"Verify password.\n";    Erreur = false;}
    if (spass2 != spass1) {	texte= texte+"The passwords are not the same.\n";    Erreur = false;}

	texte= texte+" Thank you.";
	if (Erreur) {}
	else
	{alert(texte);}
return Erreur
}


//
////
function checkmailcre(){

Erreur = true;
	sname 		= document.form1.u_mailbox.value;
	sname=sname+"@xsagency.com";
	texte="";
	 

  var re = /([a-z0-9]+([-_]?[a-z0-9]+)*.)*[a-z0-9]+([-_]?[a-z0-9]+)*@([a-z0-9]+([-_]?[a-z0-9]+)*.)+[a-z]{2,4}/gi;  


    if ((sname == "") || (! sname) || (sname.match(re) != sname)) {	texte= texte+"enter a name without space and special characters .\n";    Erreur = false;}

	texte= texte+" Thank you.";
	if (Erreur) {}
	else
	{alert(texte);}
return Erreur;
}


//
function checkgetinfo(){

Erreur = true;
	sname 		= document.getinfo.NOM.value;
	sPRENOM 	= document.getinfo.PRENOM.value;
	sADRESSE 	= document.getinfo.ADRESSE.value;
	sville		= document.getinfo.VILLE.value;
	sCODEPOSTAL = document.getinfo.CODEPOSTAL.value;
	scountry 	= document.getinfo.pays.value;
 	sEmail0	 	= document.getinfo.EMAIL.value;
	texte="";
	
    if ((sname == "") || (! sname)) {	texte= texte+"enter your name.\n";    Erreur = false;}
    if ((sPRENOM == "") || (! sPRENOM)) {	texte= texte+"enter your lastname.\n";    Erreur = false;}
    if ((sADRESSE == "") || (! sADRESSE)) {	texte= texte+"enter your address.\n";    Erreur = false;}
    if ((sville == "") || (! sville)) {	texte= texte+"enter your city.\n";    Erreur = false;}
    if ((sCODEPOSTAL == "") || (! sCODEPOSTAL)) {	texte= texte+"enter your zip code.\n";    Erreur = false;}
    if (scountry == ":-:")  {	texte= texte+"Choose your country.\n";    Erreur = false;}
    if ((sEmail0 == "") || (! sEmail0)) {	texte= texte+"enter your e-mail\n";    Erreur = false;}
//    if ((sTel == "") || (! sTel)) {	texte= texte+"enter your phone number\n";    Erreur = false;}

	texte= texte+" Thank you.";
	if (Erreur) {}
	else
	{alert(texte);}
return Erreur
}
//

function PopupImage(img,name) {
	titre="";
	w=open("",'image','width=610,height=850,toolbar=no,scrollbars=no,resizable=yes,location=no,top=1');	
	w.document.write("<HTML><HEAD><TITLE>XSagency.com-"+name+"-</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+30,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><table align='center' valign='middle'><tr><td><IMG src='"+img+"' border='0'></td></tr></table>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function PopupImageFlyer(img,name) {
	titre="";
	w=open("",'image','width=610,height=850,toolbar=no,scrollbars=yes,resizable=yes,location=no,top=1');	
	w.document.write("<HTML><HEAD><TITLE>XSagency.com-"+name+"-</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+30,document.images[0].height+100); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><table align='center' valign='middle'><tr><td><IMG src='"+img+"' border='0'></td></tr></table>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

//
function swapimg(dest,tail) {
separateur=dest.lastIndexOf("photos");
fin=dest.length;
page=dest.substring(separateur,fin);
destination="photos/"+page;
if(tail = "width=317"){tail="";}
document.getElementById("imagegd").innerHTML="<a href=\"javascript:PopupImage('"+dest+"','')\"><img src='"+dest+"' "+tail+" width='290' border='1' class='imagemodel ui-corner-all'></a>";
}

//

//
function swapimg2(dest,tail,cil) {
separateur=dest.lastIndexOf("photos");
fin=dest.length;
page=dest.substring(separateur,fin);
destination="photos/"+page;
document.getElementById(cil).innerHTML="<a href=\"javascript:PopupImage('"+dest+"','')\"><img src='"+dest+"' "+tail+" width='290' border='1' class='imagemodel ui-corner-all'></a>";
}

//


function run_filter(obj){
if(obj && obj.filters && obj.filters[0]){
		obj.filters[0].apply();
		obj.filters[0].play();
	
	}
}
iv=0
function run_ter(obj){
if (iv==0) {
iv=1
		obj.filters[0].apply();
		obj.filters[0].play();
}
}

iv2=0
function run_ter2(obj){
if (iv2==0) {
iv2=1
		obj.filters[0].apply();
		obj.filters[0].play();
}
}