
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function submit_contact_form(form)
{
		if(form.name.value == '')
		{
				form.name.focus();
				alert('Come on friend, Give your name plz..');
				return false;
		}
		if(form.email.value == '')
		{	
			form.email.focus();
			alert('Your email is needed for getting back to you.\nSo please type in your email.');
			return false;
		}
		p=form.email.value.indexOf('@');
                if (p<1 || p==(form.email.length-1))
		{
				form.email.select();
                                form.email.focus();
				alert('Why you are giving wrong email address ??\n');
				return false;
		}
		if(form.message.value == '')
		{

				form.message.focus();
				alert('If you had nothing to write, then why you pressed Go ?');
				return false;
		}
		
		if(form.age.value == '')
		{
				form.age.focus();
				check =  confirm('Telling me your age wont harm you. Do you want to enter your age ?');
				if(check)
					return false;
		}
		if(form.country.value == '')
		{
				form.country.focus();
				check =  confirm('Dont you would like to tell me where are you from ?');
				if(check)
					return false;
		}
	
		if(isNaN(form.age.value))
		{
				form.age.select();
				alert('How come your age is not numeric ? ');
                                return false;
		}
		var name = escape(form.name.value);
		var email = escape(form.email.value);
		var age = escape(form.age.value);
		var country = escape(form.country.value);
		var gender = escape(form.gender.value);
		var subject = escape(form.subject.value);
		var message = escape(form.message.value);


		var scriptlocation = 'http://www.jdk.f2s.com/contactscript.php?';
	
		var URL = scriptlocation + 'action=send&' + 'name=' +name+'&email=' + email + '&age=' +age  +'&country=' +country + '&gender=' + gender + '&subject=' + subject + '&message=' + message ;
//		alert(URL);

		MM_openBrWindow(URL,'contactwindow','width=300,height=300 ');

	
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
 
}

function submit_form(formname)
{
		
		action = formname.action.value;
		contact = formname.contact.value;
		subject= formname.subject.value;
		data = formname.data.value;
		action = escape(action);
		contact = escape(contact);
		subject = escape(subject);
		data =escape(data);
		var scriptlocation = 'http://www.jdk.f2s.com/mailer.php?';
		var URL = scriptlocation +"action="+action+"&contact="+contact+"&subject="+subject+"&data="+data+'';
		MM_openBrWindow(URL,'mailwindow','width=300,height=300 ');
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}



function submit_poll(formname)
{
		
		
		var poll_id = formname.poll_id.value;
		var action = 'vote';
		var vote_finder = formname.vote;
                var message = formname.vote.type;
                var votetype = formname.vote.type;
                var vote_value='';
//                alert(votetype);
                if(votetype == "select-one")
                 {
                         //alert(votetype);
                         var vote_value = vote_finder.value;
                         var vote_temp = vote_finder.selectedIndex;
                         //alert('You have selected' + vote_temp );
                         // alert('vote option is ' +vote_finder.options[vote_temp].value);
                         vote_value = vote_finder.options[vote_temp].value;

                }
                else
                {

         	for(var i=0;i < vote_finder.length ; i++ )
			{
				if(vote_finder[i].status)
				{
					vote_value = vote_finder[i].value;
				}

			}
                }
		var scriptlocation = 'http://www.jdk.f2s.com/poll/jdkpoll.php?';
		var URL = scriptlocation +"action="+action+"&poll_id="+poll_id+"&vote="+vote_value;
//		alert(URL);
		MM_openBrWindow(URL,'votewindow','width=500,height=300 ');
}

//Begin dHTML Toolltip Timer
var tipTimer;
//End dHTML Toolltip Timer

//-----------------------------------------------------------------------------
// This code prevents other sites from linking directly to the file on this
// site. If you wish to use this file, please download a copy to place on your
// own site. You can then remove the following to make it work.
//-----------------------------------------------------------------------------



// End of link check.


// Timing and positioning constants for tool tip display.

var toolTipWait = 0;    // Delay before showing tool tip.
var toolTipShow = 1000;    // Time to keep tool tip active.
var toolTipxOff =    20;    // Horizontal distance from mouse.
var toolTipyOff =   20;    // Vertical distance from mouse.

function startToolTip(name) {

  var tip = getLayer(name);

  // Clear out any pending timer.

  if (tip.timerID)
    clearTimeout(tip.timerID);

  // Set timer to show tool tip.

  tip.timerID = setTimeout('showToolTip("' + name + '")', toolTipWait);
}

function showToolTip(name) {

  var tip = getLayer(name);

  // Clear out any pending timer.

  if (tip.timerID)
    clearTimeout(tip.timerID);

  // Position and show the tool tip.

  moveLayerTo(tip, mouseX + toolTipxOff, mouseY + toolTipyOff);
  showLayer(tip);

  // Set timer to hide the tool tip after a delay.

  tip.timerID = setTimeout('hideToolTip("' + name + '")', toolTipShow);
}

function hideToolTip(name) {

  var tip = getLayer(name);

  // Clear out any pending timer.

  if (tip.timerID)
    clearTimeout(tip.timerID);

  hideLayer(tip);
}


<!--
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->



function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->


function submit_formu(form) {

      
        var email = form.update_email.value;
        email = escape(email);
        url = 'http://www.jdk.f2s.com/update.php?action=ask&update_email='+ email;
        MM_openBrWindow(url,'updatewindow','width=300,height=300  ');
     
      
  
  }

function submit_formr(form) {

      
        var email = form.refer_email.value;
        email = escape(email);
        url = 'http://www.jdk.f2s.com/refer.php?action=ask&refer_email='+ email;
        MM_openBrWindow(url,'referwindow','width=300,height=300  ');
     
      
  
  }
// STOP HIDING FROM OTHER BROWSERS -->

function locateObject(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;
}

function hideTooltip(object)
{
if (document.all)
{
	locateObject(object).style.visibility="hidden"
	locateObject(object).style.left = 1;
	locateObject(object).style.top = 1;
return false
}
else if (document.layers)
{
	locateObject(object).visibility="hide"
	locateObject(object).left = 1;
	locateObject(object).top = 1;
	return false
}
else
	return true
}

function showTooltip(object,e, tipContent, backcolor, bordercolor, textcolor, displaytime)
{
	window.clearTimeout(tipTimer)

	if (document.all)
		{
			locateObject(object).style.top=document.body.scrollTop+event.clientY+20

			locateObject(object).innerHTML='<table style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="10" border="0" cellspacing="1" cellpadding="1"><tr><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> '

			if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
				{
					locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
				}
			else
			{
			locateObject(object).style.left=document.body.scrollLeft+event.clientX
			}
		locateObject(object).style.visibility="visible"
		tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		return true;
		}
	else if (document.layers)
		{
		locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="10" border="0" cellspacing="0" cellpadding="2"><tr bgcolor="'+backcolor+'"><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')
		locateObject(object).document.close()
		locateObject(object).top=e.y+20

		if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth))
			{
				locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
			}
		else
			{
			locateObject(object).left=e.x;
			}
		locateObject(object).visibility="show"
		tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		return true;
	}
	else
	{
		return true;
	}
}


function displayWindow(theURL,winName,width,height,features) { //v3.1
// Made by Eddie Traversa modified from Macromedia Code
// http://nirvana.media3.net/
    var window_width = width;
    var window_height = height;
    var newfeatures= features;
    var window_top = (screen.height-window_height)/2;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open(''+ theURL + '',''+ winName + '','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + newfeatures + '');
    newWindow.focus();
}

//-->
