﻿function checkForm(obj)
{
    strPhone = obj.phone.value.replace("-","");
    if (strPhone == "")
    {
        alert("אנא הכנס טלפון בבקשה");
        return false;
    }
	for (j=0; j<strPhone.length; j++) 
	{
		if ((strPhone.charAt(j) < "0") || (strPhone.charAt(j) > "9"))
		{ 
			if (strPhone.charAt(j) != "-")
			{
				alert("חובה להכניס רק מספרים");
				return false 
			}
		}
	}
	if (strPhone.length > 11)
	{
		alert("טלפון ארוך מידי");
		return (false);
	}
	if (strPhone.length < 9) 
	{
		alert("טלפון קצר מידי");
		return (false);
	}
	if ( (strPhone.substring(0,2) == "02") || (strPhone.substring(0,2) == "03") ||
 		 (strPhone.substring(0,2) == "08") || (strPhone.substring(0,2) == "09") ||
	     (strPhone.substring(0,2) == "04") || (strPhone.substring(0,3) == "050") ||
	     (strPhone.substring(0,3) == "054") || (strPhone.substring(0,3) == "052") ||
		 (strPhone.substring(0,3) == "077") || (strPhone.substring(0,3) == "072")  )
	{
		//trace("alert: yes");
	}
	else
	{
		alert("קידומת לא תקינה");
		return (false);
	}
	if ( ( (strPhone.substring(0,2) == "02") || (strPhone.substring(0,2) == "03") ||
 		 (strPhone.substring(0,2) == "08") || (strPhone.substring(0,2) == "09") ||
	     (strPhone.substring(0,2) == "04")  ) && ( (strPhone.substring(2,3) == "0") || (strPhone.substring(2,3) == "1") ) )
    {
        alert("טלפון לא תקין");
		return (false);
	}
	if ( ( (strPhone.substring(0,3) == "050") ||
	     (strPhone.substring(0,3) == "054") || (strPhone.substring(0,3) == "052") ||
		 (strPhone.substring(0,3) == "077") || (strPhone.substring(0,3) == "072") ) && ( (strPhone.substring(3,4) == "0") || (strPhone.substring(3,4) == "1") ) )
	{
        alert("טלפון לא תקין");
		return (false);
	}
    return true;
}


function write_video(videoFile,linkBanner)
{
    if (AC_FL_RunContent == 0) 
    {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '260',
            'height', '210',
            'src', 'http://www.marrynet.co.il/video/video',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'transparent',
            'devicefont', 'false',
            'id', 'video',
            'name', 'video/video',
            'menu', 'true',
            'allowFullScreen', 'true',
            'allowScriptAccess','always',
            'movie', 'http://www.marrynet.co.il/video/video',
            'FlashVars','linkBanner='+linkBanner+'&videoUrl=' + videoFile, 
            'salign', ''
            ); //end AC code
    }
}


function write_banner(swfFile)
{
    swfFile = swfFile.replace('.swf','')

    if (AC_FL_RunContent == 0) 
    {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '975',
            'height', '100',
            'src', swfFile,
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'transparent',
            'devicefont', 'false',
            'id', 'banner',
            'name', 'banner',
            'menu', 'true',
            'allowFullScreen', 'true',
            'allowScriptAccess','always',
            'movie', swfFile,
            'FlashVars','', 
            'salign', ''
            ); //end AC code
    }
}
