
//	START Temporary Live Construction Stickers. Remove after the Site is complete

function showLiveConstSticker(){
	if(_isIPhone==false){

		//Generate a random number
		var num=Math.random();
	
		//Take that random number, multiply by 4, and round down, then add 1 (yields 1, 2, or 3)
		var num3=(Math.floor(num*3))+1;
	
		//Make conditional statements and assign each randomly generated number to a sticker
	//	090425 Take this one out because it was blocking the upper right corner in the portfolio page under a 1024x768 screen.
	//	if(num3==1){
	//		document.write('<div id="liveConstBucket" style="width:117px;height:117px;padding:10px 10px 0 0;position:fixed;right:0;top:0;z-index:201;">');
	//		document.write('<img src="http://www.ivanwlam.com/images/liveConst/liveConstBucket.png" alt="Live Construction Bucket Sticker" />');
	//		document.write('</div><!--end div liveConstBucket -->');
	//	}
		
	//	if(num3==2){ // changing the condition because i took out the one above.
		if(num3==3){
			document.write('<div id="liveConstScale" style="width:100%;height:71px;margin:0 0 0 0;background-color:#fff;border-top:3px ridge #999;position:fixed;left:0;bottom:0;z-index:2202;">');
			document.write('<img src="http://www.ivanwlam.com/images/liveConst/liveConstCodeAnimated.gif" alt="Live Construction Code Sticker" />');
			document.write('</div><!--end div liveConstScale -->');
			document.body.style.paddingBottom="74px";
		}
		
		if(num3<=2){
			document.write('<div id="liveConstScale" style="width:307px;height:42px;padding:0 10px 10px 0;position:fixed;right:0;bottom:0;z-index:2203;">');
			document.write('<img src="http://www.ivanwlam.com/images/liveConst/liveConstScale.png" alt="Live Construction Scale Sticker" />');
			document.write('</div><!--end div liveConstScale1 -->');
		}
	} //end isIPhone
}

if(document.body.className.indexOf("page_photo")<0){ // show construction sticker for all pages except photo experiment page
	showLiveConstSticker();
	}


//	END Temporary Live Construction Stickers.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// START Basic Cookie Scripts Created 14 Sept 2008

// Function 1: setCookie(name,value,days)
// Function 2: getCookie(name)				// returns the cookie value
// Function 3: clearCookie(name)

// Note: To make things clear, cookie names begin with "c_"

//The following functions contains parts that derives from the Cookies tutorial on quirksmode.org
function setCookie(name,value,days){
	//if "days" is defined
	if (days){
		// create new date to be defined as number of days from now that the cookie will expire
		var date=new Date();
		// the math behind setting the date
		date.setTime(date.getTime()+(days*24*60*60*1000));
		// get a new var to hold the date in GMT format
		var expires=date.toGMTString();
		} else {
		//if "days" isn't defined, just make "expires" nothing, so the cookie will expire right after the browser closes
		var expires="";
		}
	
	//put the cookie together: name, value, expiration date
	document.cookie=name+"="+escape(value)+"; expires="+expires;
	}
	
//

//The following functions contains parts that derives from the Cookies tutorial on quirksmode.org
function getCookie(name){
	// get new var for convenience
	var nameEq=name+"=";
	// define an array for the cookies, which are split up with the ";"
	var cookieArray=document.cookie.split(";");
	// run through all the cookies
	for (var i=0;i<cookieArray.length;i++){
		// temporarily label each cookie unit
		var cookieUnit=cookieArray[i];
		// before doing anything to the cookieUnit, check to see if there are spaces, if there are, only use the part without the space
		while (cookieUnit.charAt(0)==" ") cookieUnit=cookieUnit.substring(1,cookieUnit.length);
		// if the name of the cookie exists at character "0," that means the cookie exists and is found. so, return the characters between the "=" after the cookie name and the end of the cookieUnit, which means: GET THE VALUE
		if (cookieUnit.indexOf(nameEq)==0) {
			return unescape(cookieUnit.substring(nameEq.length,cookieUnit.length));
			} 
		}
	}
	
//

// Simplified way to clear a cookie
function clearCookie(name){
	//set the cookie to a blank value with the expiration date as yesterday, resulting in immediate removal
	setCookie(name,"",-1)
	}
	
// END Basic Cookie Scripts


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


