



// For video only, pass url, title, w, h

function videoWin(filename,title,w,h) {

	if (! filename) { alert('no file specified.'); return; }
	// filename.replace(/\s+/ig,'%20');
	var url = 'http://web.3.c3.audiovideoweb.com/3c3web1215/'+filename;
	var day= new Date();
	var id = day.getTime();
	var ww = w+75;
	var wh = h+175;
	if ((screen.height) && (wh > screen.height-100)) { wh = screen.height-100; }
	var params = 'width='+ww+',height='+wh+',scrollbars,resizable';
	var t = (title != '')?title:filename;
	var msg='<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN" "http:\/\/www.w3.org/TR\/html4\/loose.dtd">\n'+
		'<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">\n'+
		'<html><head><title>'+t+'<\/title><\/head>'+
		'<style type="text\/css">\n'+
		'html,body { font-family: Arial,Helvetica,Sans-Serif; text-align: center; }\n'+
		'h3,form,div{ text-align: center; margin:auto;}\n'+
		'div { width:495px;height:420px; )\n'+
		'<\/style><body>\n'+
		'<h3>'+t+'<\/h3>\n'+
		'<div id="archive-video"><a href="http://get.adobe.com/flashplayer/" target="new window"><img src="/images/large-video-placeholder.gif" witdth="495" height=" 420" border="0" alt="Click this image to install the Adobe Flash player"></a></div>\n'+
		'<scr'+'ipt'+' type="text/jav'+'asc'+'ript" src="/data/swfobject.js"></scr'+'ipt>\n'+
		'<scr'+'ipt'+' type="text/jav'+'asc'+'ript">'+
		'window.onload=function() {'+
			'if (document.getElementById("archive-video")) {\n'+ 
				'var gv_video = new SWFObject("/images\/archive-player.swf", "video-embed", "495", "420", "6", "#000000");\n'+
				'gv_video.addParam("wmode", "transparent");\n'+
				'gv_video.addParam("allowFullScreen", "true");\n'+
				'gv_video.addVariable("url", "'+url+'");\n'+
				'gv_video.addVariable("vtitle", "'+t+'");\n'+
				'gv_video.write("archive-video");\n'+
			'}'+
		'};'+ 
		'</scr'+'ipt>\n'+
		'<form><hr width="100%" size="1"><input type="button" onClick="javascript:window.close();" value="Close Window">\n'+
		'<hr width="100%" size="1"><\/form><\/body><\/html>\n';
	      var win = open('',id,params);
		  win.document.write(msg);
		  win.document.close();
		  return false;
}
// For contact.html only.

function checkContact(form) {

        var requireds = new Array('Name', 'Email', 'Source');
        var obj,msg = "";

        for (i=0; i<requireds.length; i++) {
            obj = document.getElementById(requireds[i]);
            if (obj.value == '') {
                if (requireds[i] == 'Source') {
                    msg = 'Please let us how you found out about Zarifa.';
                }
                else { msg = 'Please provide your ' + requireds[i] + ' before submitting this form.';  }
                break;
            }
        }
        if ((msg == '') && (form.Email.value != "")) {
            var found = false;
            var emailString = form.Email.value;
            for (j=0; j < emailString.length; j++) {
                if (emailString.charAt(j) == "@") { found = true; }
            }
            if (found == false) {
                msg = 'Is that your true email address?\n' +
                      'Please enter your correct email address.\n' +
                      'We will not place you on any mailing lists!\n';
            }
        }

        if (msg == '') { form.submit(); }
        else {  alert(msg);  }
        return false;

   }
   

