var xmlHttp
////////////////////////email////////////////


function showCustomer(str)
{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
		alert ("Your browser does not support AJAX!");
		return;
		} 
		var url="check.php";
		url=url+"?q="+str;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function stateChanged() 
{ 
		if (xmlHttp.readyState==4)
		{ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		
		}
}
/////////////////////////////////////////


/////////////confirm email//////////////
function showCustomer1(str)
{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
		alert ("Your browser does not support AJAX!");
		return;
		} 
		var url="check.php";
		url=url+"?q="+str;
		xmlHttp.onreadystatechange=stateChanged1;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function stateChanged1() 
{ 
		if (xmlHttp.readyState==4)
		{ 
	    document.getElementById("txtConfirmHint").innerHTML=xmlHttp.responseText;
		
		}
}
//////////////////////////////////////////

//////////////////Password///////////////
function pass(str)
{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
		alert ("Your browser does not support AJAX!");
		return;
		} 
		var url="check.php";
		url=url+"?q="+str;
		xmlHttp.onreadystatechange=stateChanged1;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function pass() 
{ 
		if (xmlHttp.readyState==4)
		{ 
	    document.getElementById("txtpaswd").innerHTML=xmlHttp.responseText;
		}
}

////////////////////////////////////////

function GetXmlHttpObject()
{
		var xmlHttp=null;
		try
		  {
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
		  }
		catch (e)
		  {
		  // Internet Explorer
		  try
			{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
		  catch (e)
			{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		  }
          return xmlHttp;
}



// This code has been placed in the public domain and may be used without
// compensation or attribution.

         ////////////////////////////////////////////////////////////////////////////////
         // Video window function, handles urls, sets up embeds, makes window visible/invisible
    
	
	////////////////////////////////////////////////////////////////////////////////


function poptastic() {
     url="fgpass.php";
	window.open(url,'name','height=300, width=250, left=370, top=670, toolbar=no, menubar=no, directories=no, location=no, scrollbars=no, status=no, resizable=no, fullscreen=no');

	//newwindow.focus();

}


function showSignup(){
var signup='';	
signup+='<A HREF="#" onClick="return(playVid())">X</A>&nbsp;&nbsp;<BR>';
signup+='<form name="newreg11" method="post" action="register2.php" onSubmit="return validsignup111();"><table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td height="30"  colspan="4" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;<font size="+1" color="3366CC"><strong>New User</strong></font></td></tr><tr><td width="8%">&nbsp;</td><td width="37%"><strong>Enter Your Name</strong></td><td width="52%"><input name="name" type="text" id="name"></td><td width="3%">&nbsp;</td></tr><tr><td align="right"><div id="txtHint"></div></td><td><strong>Email Address</strong></td><td><input name="emailr" type="text" id="emailr" onBlur="showCustomer(this.value)"></td><td>&nbsp;</td></tr><tr><td align="right"><div id="txtConfirmHint"></div></td><td><strong>Confirm Email</strong></td><td><input type="text" name="confirmemail" onBlur="showCustomer1(this.value)"></td><td>&nbsp;</td></tr><tr><td colspan="4">&nbsp;</td></tr><tr><td align="right"><div id="txtpaswd"></div></td><td><strong>Password</strong></td><td><input name="password" type="password" id="password"  onBlur="pass(this.value)"></td><td><div id="txtpaswddesc"></div></td></tr><tr><td>&nbsp;</td><td><strong>Confirm Paswd</strong></td><td><input name="rpassword" type="password" id="rpassword" onBlur="showCustomer(this.value)"></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td><input type="submit" name="submit1" value="SignUp"></td><td>&nbsp;</td></tr></table></form>';
_vidPane.innerHTML="";
_vidPane.innerHTML=signup;

              
}


         function playVid(vidId, noBlackout) {

            ////////////////////////////////////////////////////////////////////////////////
            // Test to see if our video and blackout divisions have been set up.
            // If no division was declared in the HTML then we'll go ahead and automatically
            // create and style the necessary division.
            ////////////////////////////////////////////////////////////////////////////////

            if (_vidPane==null) {
               ////////////////////////////////////////////////////////////////////////////////
               /// Video Pane wasn't set up so see if it's declared in the HTML
               ////////////////////////////////////////////////////////////////////////////////
               _vidPane=document.getElementById('vidPane');
               if (!_vidPane) {
                  // user didn't create the division so create it for him.
                  // also asume no styleSheet and set basic styles.
                  var tbody = document.getElementsByTagName("body")[0];
                  tnode = document.createElement('div');
                  tnode.id='vidPane';
				  tnode.align='right';
                  tnode.className='vidFrame';
                  tbody.appendChild(tnode);
                  _vidPane=document.getElementById('vidPane');
                  _vidPane.style.position='fixed';
                  _vidPane.style.display='none';
                  _vidPane.style.backgroundColor='#FFFFFF';
                  _vidPane.style.border='10px solid #EFF5FF';
                  _vidPane.style.width='400px';
                  _vidPane.style.height='50px';
                  //_vidPane.style.left='450px';
                  //_vidPane.style.top='800px';
                  _vidPane.style.cursor='move';
                  _vidPane.style.fontFamily='verdana';
                  _vidPane.style.fontSize='8pt';
                  _vidPane.style.zIndex='100';
                  _vidPane.style.MozBorderRadius='0';
               }

               // If _vidPane wasn't defined then for sure _blackout wasn't
               // so see if it was defined in the HTML
               _blackout=document.getElementById('blackout');

               if (!_blackout) {
                  // user didn't create the division so create it for him.
                  // also asume no styleSheet and set basic styles.
                  tnode = document.createElement('div');
                  tnode.id='blackout';
				  tnode.align='center';
                  tbody.appendChild(tnode);
                  _blackout=document.getElementById('blackout');
                  _blackout.style.position='fixed';
                  _blackout.style.display='none';
                  _blackout.style.left='0px';
                  _blackout.style.top='0px';
                  _blackout.style.backgroundColor='#555555';
                  _blackout.style.opacity='0';
                  _blackout.style.filter='alpha(opacity=90)';
                  _blackout.style.zIndex='50';
               }
               // Initialize the starting location of the video.
               _vidPane.style.top='850px';    // Starting location horozontal
               _vidPane.style.left='350px';   // Starting location verticle
            }

            // Shows (or hides) the vidPane layer.   Accepts 2 parameteres.
            // vidId is null (close window) or an anchor object (contains HREF value)
            // vidId is mandatory example: <a href="someservice.com/somevideo.swf" onClick='return playVid(this);'></a>
            // noBlackout is optional. If you pass true, the background will not be "greyed out".

            if (vidId==null) { 
               // Null is passed by the "close" link, so we'll hide the layer.
               _vidPane.style.display='none';         // Hide the division.
               _vidPane.innerHTML='';                 // purge it's html (kill video)
               _blackout.style.display='none';        // Hide the blackout layer.
            } else {
               // Snag the url from the passed object
               vidId=vidId.href;

               // Next three lines make the blackout layer visible
               // and makes sure it covers the entire page.
               if (!noBlackout) {
                  _blackout.style.width='100%';
                  _blackout.style.height=(document.body.offsetHeight<screen.height) ? screen.height+'px' : document.body.offsetHeight+20+'px'; 
                  _blackout.style.display='block';
               } else {
                  _blackout.style.display='none';        // Hide the blackout layer.
               }
               // Break out the URL passed to this function (so vidInfo[0]=http, [1]=domain, etc
               var vidInfo = vidId.split('/');

               // We're building a temporary string called vidstring. 
               // vidstring will hold the HTML as we build it based on the service
               // being used.  The next few lines contains items which are common
               // to all the services, or at least ignored if not directly used.
               
               var vidstring ='';
               vidstring+='<A HREF="#" onClick="return(playVid())">X</A>&nbsp;&nbsp;';
               vidstring+='<form name="login" method="post" >';  
               vidstring+='<div id="fg1"><table  width="80%" border="0" cellspacing="2" cellpadding="2" align="left" vlaign="top"><tr><td width="100%"><strong>Your inappropriate request send successfully</strong></td></tr><tr><td width="100%" align="right">&nbsp;</td></tr></table></div></form>';	   
			   
			   
               if (vidInfo[2].indexOf('youtube.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // YouTube (Use browser URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/v=.+$/);
                  vidInfo=String(vidInfo).replace(/v=/g,'');
                  
               } else if (vidInfo[2].indexOf('video.google.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Google (Use browser URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/docid=.+$/);
                  vidInfo=String(vidInfo).replace(/docid=/g,'');
                  
               } else if (vidInfo[2].indexOf('metacafe.com')>0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // MetaCafe (Use browser URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/watch.+$/);
                  vidInfo=String(vidInfo).replace(/watch./,'');
                  vidInfo=String(vidInfo).replace(/.$/,'');
                  
               } else if (vidInfo[2].indexOf('ifilm.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // iFilm (Use browser URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/video.+$/);
                  vidInfo=String(vidInfo).replace(/video./,'');
                 
               } else if (vidInfo[2].indexOf('dailymotion.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Daily Motion (Use EMBED URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  
               } else if (vidInfo[2].indexOf('break.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Break (use EMBED URL, autostarts)
                  ////////////////////////////////////////////////////////////////////////////////
                  
               } else if (vidInfo[2].indexOf('shoutfile.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Shoutfile (use EMBED URL, does not autostart)
                  ////////////////////////////////////////////////////////////////////////////////
                  
               } else if (vidInfo[2].indexOf('soapbox.msn.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // MSN Soapbox (use the LINK, autostarts)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/vid=.+$/);
                  vidInfo=String(vidInfo).replace(/vid=/g,'');
                  
               } else if (vidInfo[2].indexOf('atomfilms.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // AtomFilms (use URL, does not autostart), pretty lame embed service IMHO
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/film\/.+(\.jsp)/);
                  vidInfo=String(vidInfo[0]).replace(/film\//g,'');
                  vidInfo=String(vidInfo).replace(/\.jsp/g,'');
                  
               } else {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Failed.
                  ////////////////////////////////////////////////////////////////////////////////
                 
               } 
               // Insert our HTML and display the video window.
               _vidPane.innerHTML=vidstring;
               // Set the Y position of the video window so it's in the visible clip
               var scrollTop = 0;
               if (document.documentElement && document.documentElement.scrollTop)
	                scrollTop = document.documentElement.scrollTop;
               else if (document.body)
	                scrollTop = document.body.scrollTop
               _vidPane.style.top=scrollTop+50+'px';
               // Video window was hidden so we'll make it visible
               _vidPane.style.display='block'; 
            }
            // return false so the browser won't follow through with A HREF clicks.
            return(false);
         }

         ////////////////////////////////////////////////////////////////////////////////
         // Drag and Grab handlers
         ////////////////////////////////////////////////////////////////////////////////

         function moveHandler(e){
            // Called automatically whenever the mouse is moved after a drag event starts
            if (e == null) { e = window.event }  // Get event data, if it wasn't passed, get it IE style.
            if ( _dragOK ){                      // is our global var set to true? is it ok to move the object?
               _savedTarget.style.left=e.clientX-_dragXoffset+'px';  //OK to move, calculate the offset and move it
               _savedTarget.style.top=e.clientY-_dragYoffset+'px';   // calculate the y offset and move it.
               return false;                                         // return false so browser doesn't try to do anything else.
            }                                   // End _dragOK check
         }                                      // End moveHandler
      
         function cleanup(e) {
            // Called whenever user lets up off a mouse button after a drag event starts
            document.onmousemove=null;                     // Turn off the mousemove event (won't call moveHandler() now).
            document.onmouseup=null;                       // Turn off the mouseup event (won't call cleanup() now).                     
            _savedTarget.style.cursor=_orgCursor;          // Restore original mouse shape
            _dragOK=false;                                 // Turn off the global constant we look for before moving stuff.
         }
      
         function dragHandler(e){
            // Called automatically when user holds down the mouse button
            var cursorType='-moz-grabbing';                               // Set mouse type to grabbing hand
            if (e == null) { e = window.event; cursorType='move';}        // This is IE so get event info IE style
            var target = e.target != null ? e.target : e.srcElement;      // Save object of the event
            if (target.className=="vidFrame") {                           // Did mouse go down over our dragable object?
               _orgCursor=target.style.cursor;                            // Remember the current mouse shape
               _savedTarget=target;                                       // Remember the object we're working with
               target.style.cursor=cursorType;                            // change mouse to "grab" icon                             
               _dragOK=true;                                              // When true, movehandler will move the window
               _dragXoffset=e.clientX-parseInt(_savedTarget.style.left);  // Remember current X offset
               _dragYoffset=e.clientY-parseInt(_savedTarget.style.top);   // Remember current Y offset
               document.onmousemove=moveHandler;                          // Call moveHandler() when mouse moves
               document.onmouseup=cleanup;                                // Call cleanup() when user lets go of mouse btn
               return false;                                              // IMPORTANT return false so browser doesn't do anything else.
            }                                                             // End Click on classname = object check
         }                                                                // End function dragHandler

         // Start the event handler. When mouse is clicked, call dragHandler()	 
      	 document.onmousedown=dragHandler;

         // Initialize global variables.
         var _savedTarget=null;        // The target layer (effectively vidPane)
         var _orgCursor=null;          // The original Cursor (mouse) Style so we can restore it
         var _dragOK=false;            // True if we're allowed to move the element under mouse
         var _dragXoffset=0;           // How much we've moved the element on the horozontal
         var _dragYoffset=0;           // How much we've moved the element on the verticle
         var _vidPane = null;          // Video Layer -- won't be defined until a video is called
         var _blackout= null;          // blackout Layer. -- won't be defined until a video is called.
		 
		 
