// JScript File

function validate_request_proposal() 
{
    if (document.form2.textfield.value == "") {
        alert("Please enter name");
        return false;
    }

    if (document.form2.textfield2.value == "") {
        alert("Please enter email");
        return false;
    }
    else
        var email = document.form2.textfield2.value;
        if (!checkemail(email)) {
        alert("Please enter valid email address");
        return false;
    }
 
    if (document.form2.textfield3.value == "") 
    {
        alert("Please enter phone number");
        return false;
    }	
    return true;	    
}


function validate_request_trail() {
    if (document.form2.textfield.value == "") {
        alert("Please enter name");
        return false;
    }

    if (document.form2.textfield2.value == "") {
        alert("Please enter email");
        return false;
    }
    else
        var email = document.form2.textfield2.value;
    if (!checkemail(email)) {
        alert("Please enter valid email address");
        return false;
    }

    if (document.form2.services.value == "Choose the Service") {
        alert("Please select anyone of the services");
        return false;
    }

    if (document.form2.textfield3.value == "") {
        alert("Please enter phone number");
        return false;
    }
    else
        return true;
}
function validate_request_website_information() 
{
    if (document.form2.textfield2.value == "") {
        alert("Please enter email");
        return false;
    }
    else
        var email = document.form2.textfield2.value;
        if (!checkemail(email)) {
        alert("Please enter valid email address");
        return false;
    }
    if (document.form2.category.value == "Select Category") {
        alert("Please select anyone of the category");
        return false;
    }
     if (document.form2.Websitetitle.value == "") {
        alert("Please enter Web site title");
        return false;
    }
    if (document.form2.Yoururl.value == "http://") {
        alert("Please enter Your url");
        return false;
    }
    if (document.form2.Sitedescription.value == "") {
        alert("Please enter Site description");
        return false;
    }
    if (document.form2.Reciprocallink.value == "http://") {
        alert("Please enter Reciprocal link");
        return false;
    }
//    if (document.form2.Googlepagerank.value == "") {
//        alert("Please enter Google page rank");
//        return false;
//    }
//    if (document.form2.Source.value == "") 
//    {
//        alert("Please select anyone of the Source");
//        return false;
//    }
    else
        return true;
}

function checkemail(vemail)
{
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(vemail))
        return true;
        else
        return false;
}
//Add link
function SendEmailWebsite() {
   //debugger;
   //validate_request_website_information()
    if (validate_request_website_information()) 
    {
        var webEmail = document.form2.textfield2.value;
        var category = document.form2.category.value;
        var websitetitle = document.form2.Websitetitle.value;
        var yoururl = document.form2.Yoururl.value;        
        var sitedescription = document.form2.Sitedescription.value;
        var reciprocallink = document.form2.Reciprocallink.value;
        var googlepagerank = document.form2.Googlepagerank.value;
        var suggestcategory = document.form2.Suggestcategory.value;
        var Source = document.form2.Source.value;
        if (webEmail !== "" && webEmail != "") {
            if (!checkemail(webEmail)) {
                alert("Please Enter a valid email address!");
                return false;
            }
            else {
                document.form2.action = "../SendWebsiteInfo.php?webEmail=" + webEmail + "&category=" + category + "&websitetitle=" + websitetitle + "&yoururl=" + yoururl+"&sitedescription=" + sitedescription+"&reciprocallink=" + reciprocallink +"&googlepagerank=" + googlepagerank +"&suggestcategory=" + suggestcategory+"&Source=" + Source;
                document.form2.submit();
            }
        }
        //alert("Thank you for submitting your information. Our Business Development Manager will call you soon.");
        return false;
    }
    else 
    {
         return false;
    
    }
}
function SendEmailInfo() {
   //debugger;
    if (validate_request_proposal()) {
        var ContactName = document.form2.textfield.value;
        var ContactEmail = document.form2.textfield2.value;
        var ContactPhone = document.form2.textfield3.value;
        var ContactMessage = document.form2.textarea.value;
        if (ContactName !== "" && ContactEmail != "") {
            if (!checkemail(ContactEmail)) {
                alert("Please Enter a valid email address!");
                return false;
            }
            else {
                document.form2.action = "SendContactInfo.php?cntName=" + ContactName + "&cntEmail=" + ContactEmail + "&cntPh=" + ContactPhone + "&cntMess=" + ContactMessage;
                document.form2.submit();
            }
        }
        //alert("Thank you for submitting your information. Our Business Development Manager will call you soon.");
        return false;
    }
    else 
    {
         return false;
    
    }
}

function SendTrialInfo() {
   //debugger;
    if (validate_request_trail()) {
        var ContactName = document.form2.textfield.value;
        var ContactEmail = document.form2.textfield2.value;
        var ContactPhone = document.form2.textfield3.value;
        var ContactMessage = document.form2.textarea.value;
        var ContactService = document.form2.services.value;

        document.form2.action = "SendContactInfo.aspx?cntName=" + ContactName + "&cntEmail=" + ContactEmail + "&cntServ=" + ContactService + "&cntPh=" + ContactPhone + "&cntMess=" + ContactMessage;
        document.form2.submit();

        //alert("Thank you for submitting your information. Our Business Development Manager will call you soon.");
        return false;
    }
    else 
    {
         return false;
    
    }
}


function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}


pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}



pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}


pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}


pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}


var pausecontent2=new Array()
pausecontent2[0]='<strong>Client: Design Firm</strong><br/>One of our clients is a design firm that provides services in Web site design, E-commerce design and development, Web-based application design and development, print collateral design, and search engine marketing.<br/><br/>They sought solutions that would help their company increase the number of projects that it could handle by increasing its staff but without increasing costs.Talent Gurus’ solution to their problem was providing them with skilled PHP (PHP:  Hypertext Preprocessor) and web programmers that work on their various client projects.'
pausecontent2[1]='<strong>Client: Consulting Firm</strong><br/>Another client is a consulting firm that provides strategic talent sourcing and acquisition, and human capital and capabilities improvement in three primary markets: Professional Services and Consulting, Corporate Boards, and Industry Executives. They sought solutions that would double their potential consultant base within a limited amount of time.Using our skilled telemarketing resources, the company was able to increase the number of leads that it generated to firms providing audit, tax, and advisory services.'
pausecontent2[2]='<strong>Client: Medical Staffing Firm</strong><br/>Another client that we have provided services to is a medical staffing firm that specializes in Locum Tenens, permanent and contract placements of physicians, physician assistants, certified registered nurse anesthetists, nurse practitioners, and other allied healthcare professionals to facilities nationwide. The company wanted various solutions that included Web design, Web development, and custom database and application design.<br/><br/>Talent Gurus provided Web designers, Web developers, and application and database developers to meet this client’s needs. Our resources designed and developed the company’s Web site as well as multiple custom database applications.'

