	<!-- Cookie functions added by jingles -->

    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 demoCookieCheck() {
      if (readCookie('creatorSelectDemoCookie')) {
        open('http://tca.creatorselect.com');
      } else {
        // contact form;        
        tb_show('','/products/creator_select/creator_select_demo.html?KeepThis=true&TB_iframe=true&height=500&width=600')
        //window.location.href="/products/creator_select/creator_select_demo.html?KeepThis=true&TB_iframe=true&height=500&width=600" //??class="thickbox" border="0";
      }
    }
    function videoCookieCheck() {
      if (readCookie('creatorSelectDemoCookie')) {
        // Cookie found, 
        tb_show('','/products/creator_select/creator_select_video.html?KeepThis=true&TB_iframe=true&height=636&width=800')
        //window.location.href="/products/creator_select/creator_select_video.html?KeepThis=true&TB_iframe=true&height=616&width=800" //??class="thickbox" border="0";
      } else {
        // Cookie not found, go to contact form;        
        tb_show('','/products/creator_select/creator_select_demo.html?KeepThis=true&TB_iframe=true&height=636&width=800')
        //window.location.href="/products/creator_select/creator_select_demo.html?KeepThis=true&TB_iframe=true&height=500&width=600" //??class="thickbox" border="0";
      }
    }
