function centerform(){

	var divCenter = document.getElementById("frameContainer");

	var width = 0;
	var height = 0;
	var scrollTop = 0;
	var scrollLeft = 0;

	if (typeof  window.innerWidth == "undefined"){
		// Internet Explorer 7
		width= parseInt(document.body.clientWidth);
		height= parseInt(document.body.clientHeight);

		scrollTop = document.body.scrollTop;
		scrollLeft = document.body.scrollLeft;
	}
	else {
		//Fire Fox
		width= parseInt(window.innerWidth);
		height= parseInt(window.innerHeight);

		scrollTop = window.pageYOffset;
		scrollLeft = window.pageXOffset;
	}

	var leftValue = parseInt(width/2 - divCenter.offsetWidth/2) + scrollLeft;
	var topValue = 10;

	if (leftValue < 0){
		leftValue = 0;
	}

	divCenter.style.left = leftValue+"px";
	divCenter.style.top =  topValue+"px";
}
function displayform(){

	fcontainer = document.getElementById("frameContainer");
	frameform = document.getElementById("promoFrame");

	fcontainer.style.display = "block";
	frameform.style.display = "block";
	centerform();
}

function closeform(){
	fcontainer = document.getElementById("frameContainer");
	frameform = document.getElementById("promoFrame");

	fcontainer.style.display = "none";
	frameform.style.display = "none";

}
/*function loadjscssfile(filename, filetype){

	//debugger;

	if (filetype=="css"){ //if filename is an external CSS file
		var fileref=document.createElement("link")
		fileref.setAttribute("rel", "stylesheet")
		fileref.setAttribute("type", "text/css")
		fileref.setAttribute("href", filename)
	}
	if (typeof fileref!="undefined")
		document.getElementsByTagName("head")[0].appendChild(fileref)
}

//dynamically load and add .css files
loadjscssfile("http://yui.yahooapis.com/2.7.0/build/container/assets/skins/sam/container.css?_yuiversion=2.7.0", "css")
loadjscssfile("http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css?_yuiversion=2.7.0", "css")
loadjscssfile("form/css/parent.css", "css")


YAHOO.namespace("example.container");

YAHOO.example.Timing = function() {

	//create shortcut for YAHOO.util.Event:
	var e = YAHOO.util.Event;

	//the returned object here will be assigned
	//to YAHOO.example.Timing and its members will
	//then be publicly available:
	return {

		init: function() {
			//assign onDOMReady handler:
			e.onDOMReady(this.fnHandler);
		},

		fnHandler: function() {

			// create the overlay object
			YAHOO.example.container.formOverlay = new YAHOO.widget.Overlay("frameContainer", {
					//fixedcenter:true,
					top:"50px",
					width:"380px",
					height:"830px",
					visible:false,
					zIndex:100001,
					effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.40} }
				);
			YAHOO.example.container.formOverlay.render("example");

			// assign overlay 'show' and 'center' events to the link click event
			YAHOO.util.Event.addListener(
				"openFrame1",
				"click",
				function (e, obj) {
					obj.center();
					obj.show();},
				YAHOO.example.container.formOverlay
			);

			YAHOO.util.Event.addListener(
				"openFrame2",
				"click",
				function (e, obj) {
					obj.center();
					obj.show();},
				YAHOO.example.container.formOverlay
			);

			YAHOO.util.Event.addListener(
				"openFrame3",
				"click",
				function (e, obj) {
					obj.center();
					obj.show();},
				YAHOO.example.container.formOverlay
			);
			// assign overlay 'hide' event to the close window click event
			YAHOO.util.Event.addListener("closeFrame", "click", YAHOO.example.container.formOverlay.hide, YAHOO.example.container.formOverlay, true);
		}
	}
}();

//initialize the example:
YAHOO.example.Timing.init();*/
