I am trying to create a Popup video tutorial for my site (video would be on utube). The popup would only open if called from the footer and upon open of an entirely new user to the site (hence the use of cookies) I have tried to make a test which is not working.

css document
Code:
#popup{
	display: none;
	position: absolute;
	top: 50%;
	left:50%;	
}

#popup img{
	width: 20px;
	height: auto;
	position: absolute;
	right: 0;
	top:-20px;
	
}
js document
Code:
$(document).ready(function(){

	$function mySetCookie(c_name,value,expriedays){
		var exdate=new Date()exdate.setDate(exdate.getDate()=expiredays)
		document.cookie=c_name+"="+escape(value)+
		((expiredays==null) ?"":";expires="+exdate.toGMTString())
		}

	$function myGetCookie(c_name){
		if(document.cookie.length>0){
			c_start=c_start + c_name.length+1
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1)
				c_end=document.cookie.length
			return unescape(document.cookie.substring(c_start,c_end))
			}
		}
		return""
	}


	$("#popup iframe").remove();

	$function showPopupOnce(){
		var hasSeenPopup=myGetCookie("has_seen_popup");
		if(hasSeenPopup==null || hasSeenPopup==""){

		$("#popup").append('<iframe width="560" height="315" src="//www.youtube.com/embed/ciEOEgR3Xi8" frameborder="0" allowfullscreen></iframe>');

		$("#popup").show();
		} return""
	mySetCookie("has_seen_popup","true",365);
	}
	

	$("#popup img").click(function(){
		$("#popup iframe").remove();
		$("#popup").hide();
})
html document
Code:
<html>

<head>
	<script type="text/javascript" src="http://www.signstopusa.com/Carousel/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="./Embedded_Vids/html_files/script.js"></script>

	<link rel="stylesheet" type="text/css" href="./Embedded_Vids/html_files/styles.css" />
</head>

<body onload="popup_open();">

	<div id="popup">
		<img src="./Embedded_Vids/html_files/close_button.png"/>

</body>
</html>
I have taken code from different places and tried to adjust them to my circumstance. As a whole it is not working. The links in my source pages link and open the source page code, but the code appears not to be running upon the open of the page. I don't think it installed a cookie on my machine though. Any help will be appreciated.