
/****************************************************
	This script is free to use as long as this info is left in
	Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

//===========================================================================================================//
//Modeless window script- By DynamicDrive.com
//for full source code and terms of use
//visit http://www.dynamicdrive.com

function modelesswin(url,mwidth,mheight){
	if (document.all&&window.print) //if ie5
	eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
	Eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
}

//===========================================================================================================//
//Animated Window- By Rizwan Chand (rizwanchand@hotmail.com)
//Modified by DD for NS compatibility
//Visit http://www.dynamicdrive.com for this script

function expandingWindow(website) {
	var windowprops='width=700,height=400,scrollbars=no,status=no,resizable=no'
	var heightspeed = 2;	// vertical scrolling speed (higher = slower)
	var widthspeed = 7;		// horizontal scrolling speed (higher = slower)
	var leftdist = 10;		// distance to left edge of window
	var topdist = 10;			// distance to top edge of window

	if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
		var winwidth = window.screen.availWidth - leftdist;
		var winheight = window.screen.availHeight - topdist;
		var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
		for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
		sizer.resizeTo("1", sizeheight);
		for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
		sizer.resizeTo(sizewidth, sizeheight);
		sizer.location = website;
	}
	else
		window.open(website,'mywindow');
}



//===========================================================================================================//
//Popup Window - By André CIKOS
//Visit http://javascript.internet.com/cookies/only-popup-once.html for this script

var expDays = 1; // number of days the cookie should last

var page = "carte-voeux2007-questo.html";
var windowprops = "width=700,height=400,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;   
}
return null;
}

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){
	var count = GetCookie('count')
	if(count == null) {
	SetCookie('count','1')
	return 1
} else {
	var newcount = parseInt(count) + 1;
	DeleteCookie('count')
	SetCookie('count',newcount,exp)
	return count
	}
}
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function checkCount() {
	var count = GetCookie('count');
	if (count == null) {
		count=1;
		SetCookie('count', count, exp);
		window.open(page, "", windowprops);
	} else {
		count++;
		SetCookie('count', count, exp);
	}
}
